Skip to content
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

Option similar to curl --insecure #31

Closed
andn99 opened this issue Aug 15, 2024 · 4 comments
Closed

Option similar to curl --insecure #31

andn99 opened this issue Aug 15, 2024 · 4 comments

Comments

@andn99
Copy link

andn99 commented Aug 15, 2024

Hello, I'm currently having an issue with using NsCurl via a mitm proxy.
The mitm proxy issues a custom certificate that I installed and trusted on my Windows machine.

When I ran a curl post request on powershell to one of my api endpoint via that proxy, I got Unknown CA error. Then I tried again with curl --insecure, it worked.

When sending the same request using NSCurl in my NSIS installer, I also got Unknown CA error. Then I tried to run it with /CACERT none /CASTORE false, I have no longer receive Unknown CA, but got the SSL Handshake error. I'm wondering if there is an option in NSCurl to ignore the certificate validation like --insecure in curl.

@negrutiu
Copy link
Owner

/CACERT none /CASTORE false is literally equivalent to --insecure
SSL handshakes might fail for multiple reasons. Could be that the MITM proxy is negociating an insecure/unsupported SSL cipher, for example...
I recommend you try the /DEBUG ... parameter to help you troubleshoot the issue.

NScurl::http GET ${url} ${destination} /DEBUG nodata "$TEMP\nscurl.debug.txt" /cacert none /castore false /END

Have a look at the debug file and see if anything stands out.

@andn99
Copy link
Author

andn99 commented Aug 16, 2024

/CACERT none /CASTORE false is literally equivalent to --insecure SSL handshakes might fail for multiple reasons. Could be that the MITM proxy is negociating an insecure/unsupported SSL cipher, for example... I recommend you try the /DEBUG ... parameter to help you troubleshoot the issue.

NScurl::http GET ${url} ${destination} /DEBUG nodata "$TEMP\nscurl.debug.txt" /cacert none /castore false /END

Have a look at the debug file and see if anything stands out.

Thanks @negrutiu ! I got the unsafe legacy renegotiation disabled error in the debug logs. It may because of openssl 3.3.1 in the latest version. I tested with older version (openssl 1.1.1) and it work (/cacert "", castore is not available for that version)

@negrutiu
Copy link
Owner

I got the unsafe legacy renegotiation disabled error in the debug logs. It may because of openssl 3.3.1 in the latest version. I tested with older version (openssl 1.1.1) and it work (/cacert "", castore is not available for that version)

That's useful info, thanks
I've made an experimental fix for it. Could you please get it from https://github.com/negrutiu/nsis-nscurl/actions/runs/10421731686 and see how it goes?

@negrutiu
Copy link
Owner

It looks like you're connecting to a server that's using an insecure/legacy renegociation protocol.
libcurl is blocking it because it doesn't meet the current crypto standards.
The latest release has a new option /SECURITY weak which enables weak crypto algorithms and improves compatibility with legacy servers.
Thanks for reporting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants