-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
httpclient ssl options issue #24394
Comments
Did you enable |
Yes. I'm compiling with -d:ssl. Nim syntax check highlights it even before compilation in VS Code. The newHttpClient() works fine without 'verifyMode=CVerifyPeer' I was trying to actually use the option because I wanted to use CVerifyNone since I was having trouble with one specific trusted site of my client with which I get: |
I also tested with the puppy library, curl, and the site works fine. Also works fine with python's request library. Here is an example link for testing with the httpclient library: http://epe.lac-bac.gc.ca/100/201/300/519_magazine/2021/31-519Jan2021.pdf |
The example is wrong, |
Thank you for your assistance. A. The team might also want to check nimsuggest. While it is now compiling after importing std/net, the VSCode extension gives a misleading squiggly mark: candidates (edit distance, scope distance); see '--spellSuggest': B. It still doesn't resolve my handshake issue with the specific site. If you have any suggestions, I would be grateful. nim compile -d:release -d:ssl --mm:orc --verbosity:1 --hints:off --run "/Users/vinodchettur/nim-workspace/Examples/malebolgia/mbtest.nim" Download Results:✗ http://epe.lac-bac.gc.ca/100/201/300/519_magazine/2018/1-519July2018.pdf [Done] exited with code=0 in 0.475 seconds C. Other sites give successful results with the same code. Download Results:✓ https://www.erudit.org/fr/revues/aequitas/2024-v30-n1-aequitas09438/1112353ar.pdf -> 1112353ar.pdf |
This is because the extension does not enable I don't know much about your problem, you could try the other options mentioned in the docs for |
Thank you once again. I will try to resolve my issue one way or the other. My code works with the puppy library so I have a fallback option. |
One last comment. There seems to be an issue that I could not resolve with that particular site. I tried different options with httpclient using newContext(protVersion = protSSLv23, verifyMode = CVerifyNone) and different protVersions and none of them worked. I imported std/net and compiled with -d:ssl. http://epe.lac-bac.gc.ca/100/201/300/519_magazine/2018/1-519July2018.pdf No issues with Puppy library, Curly library or curl with Nim. I also tested that site with libcurl and C, requests and python, reqwests and Rust, net/http and Go and there was no issue at all. |
Description
When I type the example under the std/httpclient (https://nim-lang.org/docs/httpclient.html#sslslashtls-support):
import httpclient
var client = newHttpClient(sslContext=newContext(verifyMode=CVerifyPeer))
I get the following:
undeclared identifier: 'newContext'
candidates (edit distance, scope distance); see '--spellSuggest':
(3, 3): 'getContent'nim(nimsuggest chk)
undeclared identifier: 'newContext'
candidates (edit distance, scope distance); see '--spellSuggest':
(3, 3): 'getContent'
t1.newContext: Error Type
Compilation gives me the same error.
Nim Version
version 2.2
Current Output
No response
Expected Output
No response
Known Workarounds
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: