You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
error: An error in the OpenSSL library: PEM lib, no start line, no start line #205
I think my problem is a multithreaded bug. there are functions as a variable for a private key and a certificate but for CA there are not. It needs to read from a file.
Do I need to make a Mutex for every SslStream? In the openssl code, I think it caches just only path as a string and when stream is created and sent, it uses CA file from a file.
You shouldn't need to do any manual locking at all. I can reproduce this on OSX's default OpenSSL install (version 0.9.8), but not with version 1.0.2 on either Linux or OSX. This could either be because there was a race condition in OpenSSL that was fixed or some part of the API behaves differently between 0.9.8 and 1.0.2 in a way that rust-openssl doesn't handle right now.
As a work around, you can grab 1.0.2 (I pulled it in via homebrew) and override the location rust-openssl will look with some environment variables that are documented in the README:
env OPENSSL_LIB_DIR=/usr/local/Cellar/openssl/1.0.2/lib/ OPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl/1.0.2/include/ DYLD_LIBRARY_PATH=/usr/local/Cellar/openssl/1.0.2/lib/ cargo run
Activity
sfackler commentedon Apr 27, 2015
Are you sure the CA file is in the right format? It should look something like
ghmlee commentedon Apr 27, 2015
Yes, I am sure. This is my CA file example.
sfackler commentedon Apr 27, 2015
Could you post a small chunk of code that reproduces the issue?
set_CA_fileseems to work fine with that cert for me with a small program:ghmlee commentedon Apr 28, 2015
I think my problem is a multithreaded bug. there are functions as a variable for a private key and a certificate but for CA there are not. It needs to read from a file.
ghmlee commentedon Apr 28, 2015
Do I need to make a Mutex for every SslStream? In the openssl code, I think it caches just only path as a string and when stream is created and sent, it uses CA file from a file.
sfackler commentedon Apr 28, 2015
You shouldn't need to do any manual locking at all. I can reproduce this on OSX's default OpenSSL install (version 0.9.8), but not with version 1.0.2 on either Linux or OSX. This could either be because there was a race condition in OpenSSL that was fixed or some part of the API behaves differently between 0.9.8 and 1.0.2 in a way that rust-openssl doesn't handle right now.
As a work around, you can grab 1.0.2 (I pulled it in via homebrew) and override the location rust-openssl will look with some environment variables that are documented in the README:
ghmlee commentedon Apr 28, 2015
@sfackler thank you so much. I appreciate your help. :)