-
Notifications
You must be signed in to change notification settings - Fork 5
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
Error: unhandled exception: cannot read from stream
with --passl:-laws-cpp-sdk-core
#7
Comments
This error message usually happened when connecting to SSL/TLS enabled server but the socket is trying to connect without SSL/TLS context. Could you pull again the I did some change with let uriserver = "mongodb+srv://myuser:[email protected]/admin?ssl=true"
var mongo = newMongo(MultiUri uriserver, poolconn = 2)
mongo.slaveOk
doAssert waitfor mongo.connect
|
I did; it shows the same error as in top post when I compile with -d:ssl, and does indeed show an informative error when I don't pass -d:ssl.
I tried both removing ssl=true, adding readPreferences=secondary, adding readPreferences=secondaryPreferred, or removing and adding one, it didn't help.
did you try with --passl:-laws-cpp-sdk-core ? |
My bad, I haven't tested with the |
looks like it happens with all the aws-cpp-sdk-* libraries ; after playing around a bit more with I'm getting the same error with: |
This is the error after I linked it to
This is indeed related to tls/ssl. It failed here Since it's calling directly the openssl shared lib, perhaps it has to do with the shared lib itself, IDK though precisely what to observe here, whether it's the openssl or just aws-cpp-sdk that broke the ssl. |
I got some interesting error message after adding for choosing the SSL/TLS protocol version
After a bit of search, maybe this is related to TLSv1.0, TLSv1.1 and TLSv1.2 ref correction, it seems not really related. |
|
So, this is kinda weird and I accidentally able to compile and running it fine, but by editing this part - It's mentioned here, openssl manpage, that I tested it on Debian Stretch with Checked with
With Nim compilation built option:
with snippet Nim code var mongo = newMongo(
MultiUri "mongodb+srv://user:[email protected]/admin?retryWrites=true&w=majority&readPreferences=secondaryPreferred",
poolconn = 2,
dnsserver = "192.168.18.1")
mongo.slaveOk
# the rest is same My case was a bit different, that the |
i think i got something to work, but using a different approach from your above suggestion (and without changing
need to run more tests though
indeed, our failures might differ; in my case I'm matching the ssl lib used in nim to match the one awslsdk-cpp depends on by way of -lcurl |
Did you add the
This is abbreviated error message, the actual was printing all pointer redirection from openssl I tried to debug and add looping to wait the context socket to be shutdown, but the operation hanged there. |
yes, following does work for me: nim r -d:ssl --dynlibOverride:ssl -d:openssl10 --passl:/usr/lib/libcrypto.44.dylib --passl:/usr/lib/libssl.44.dylib --passl:-laws-cpp-sdk-core $timn_D/tests/nim/all/t11095.nim with when true:
import pkg/anonimongo
import std/sha1
let uriserver = "mongodb+srv://user:[email protected]/admin"
proc main() =
var mongo = newMongo(MultiUri uriserver, poolconn = 2)
mongo.slaveOk
doAssert waitfor mongo.connect
doAssert waitfor mongo.authenticate[:SHA1Digest]
defer:
close mongo
var coll = mongo["test"]["col1"]
let currNDoc = waitfor coll.count()
echo currNDoc
main()
haven't tried yet |
that one did not work:
so the only thing that works for me is what I described above #7 (comment)
note that nim's |
Since this issue is specific to the openssl version, I'll leave this issue open as the fix should be in openssl wrapper lib. |
note:
-laws-cpp-sdk-core
for the rest of my applicationbrew install aws-sdk-cpp
(aws-sdk-cpp 1.7.290, but also after brew upgrade aws-sdk-cpp to install latest 1.8.20)
The text was updated successfully, but these errors were encountered: