-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable/Enable SSL certificate verification #370
Comments
I was able to disable with hardcode: |
@ruslK This has been answered here Are these self signed certificates or private network API call or behind a proxy ? A working example that might be of help #293 Note: You will have to ignore parts that doesn't relate to your case in the above example Additionally, if you have the cert/key pair you can provide it the agent in |
We would be happy disable SSL with pactum, not with |
@leelaprasadv |
Yes, the example provides you with details on how to use an agent, the suggestion was to pick the block of code related to the agent from the example. const https = require('https');
// If you have the cert/key pair
const key = fs.readFileSync("server.key")
const cert = fs.readFileSync("server.crt")
const agent = new https.Agent({
cert: cert, // Optional - add if cert available
key: key, // Optional - add if key is available
rejectUnauthorized: false // Ignore certificate errors
});
pactum.spec()
.get('<https url>')
.withCore({agent: agent })
.expectStatus(200) For follow Redirects, refer to the documention https://pactumjs.github.io/api/requests/withFollowRedirects.html#withfollowredirects |
@leelaprasadv
what is deep of Redirect? one redirect or not? |
PactumJS relies on phin.js for http/https requests and it has a default follow redirect count of 20. Changes to support configuring redirect count in PactumJS can be expected in the next couple of releases. As for debug logs for redirects, |
@leelaprasadv
It is working, but I have issue with cookies, cookies are not passing for next redirected call. So it possible to Enable Cookies Jar with PactumJS? looks like someone else looking for same: #112 |
Closing the issue as the original question is answered. Please follow up rest of the queries in existing discussions or start a new one if required. |
Is your feature request related to a problem? Please describe.
We are required to hit our endpoint which is HTTPS with SSL, and we are getting error:
Error: unable to verify the first certificate
Describe the solution you'd like
Able to Disable and Enable SSL certificate verification
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: