This topic was automatically generated from Slack. You can find the original thread here.
@Mario looking for some help diagnosing this error when making this request...
This topic was automatically generated from Slack. You can find the original thread here.
@Mario looking for some help diagnosing this error when making this request...
I’m sorry, but I need more information to help you diagnose the error. Can you please provide more details about the request you’re making and the error message you’re encountering?
import axios from "axios";
import { HttpsProxyAgent } from 'https-proxy-agent';
export default defineComponent({
async run({ steps, $ }) {
const agent = new HttpsProxyAgent(`http://username:password@zproxy.lum-superproxy.io:22225`);
const config = {
method: "GET",
url: "https://www.google.com/search?q=berry+compliant+shoes&gl=us&hl=en&num=100&location=United+States&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw",
httpsAgent: agent
};
return await axios.request(config);
}
});
error from pipedream says “unable to verify the first certificate”
that is the code i am trying to use…
Please check the code and error above - can you tell me why we might be encountering a certificate error sending an HTTP request through this proxy?
The “unable to verify the first certificate” error you’re encountering is likely due to the proxy server using a self-signed certificate or a certificate that is not trusted by the Node.js runtime. To resolve this issue, you can try adding the rejectUnauthorized: false
option to the HttpsProxyAgent
configuration. This will bypass the certificate validation process. Please note that this might expose you to security risks, such as man-in-the-middle attacks, so use it with caution. Here’s the updated code: ```
import axios from “axios”; import { HttpsProxyAgent } from ‘https-proxy-agent’; export default defineComponent({ async run({ steps, $ }) { const agent = new HttpsProxyAgent({ host: “username:password@zproxy.lum-superproxy.io”, port: 22225, rejectUnauthorized: false }); const config = { method: “GET”, url: “berry compliant shoes - Google Search”, httpsAgent: agent }; return await axios.request(config); } });