summaryrefslogtreecommitdiff
path: root/drivers/openssl/stream_peer_openssl.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-05-01 09:53:37 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-05-01 09:53:37 -0300
commit4dc4e96c8a4fb7e34ecae3a39ef0f3f3fb275e97 (patch)
tree73da4d4d6d0fa1b4c6761a63ac3674aead8b12e3 /drivers/openssl/stream_peer_openssl.cpp
parent5ab65f0eadec6a67eda622787206a01c8af2cf7e (diff)
-OpenSSL Fixes
Diffstat (limited to 'drivers/openssl/stream_peer_openssl.cpp')
-rw-r--r--drivers/openssl/stream_peer_openssl.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/openssl/stream_peer_openssl.cpp b/drivers/openssl/stream_peer_openssl.cpp
index 2414533df2..0751c76e3d 100644
--- a/drivers/openssl/stream_peer_openssl.cpp
+++ b/drivers/openssl/stream_peer_openssl.cpp
@@ -1,9 +1,6 @@
-#include "stream_peer_openssl.h"
#ifdef OPENSSL_ENABLED
-#include "globals.h"
-#include "os/file_access.h"
-#include "curl_hostcheck.h"
+#include "stream_peer_openssl.h"
//hostname matching code from curl
@@ -109,6 +106,7 @@ int StreamPeerOpenSSL::_cert_verify_callback(X509_STORE_CTX *x509_ctx, void *arg
bool base_cert_valid = X509_verify_cert(x509_ctx);
if (!base_cert_valid) {
print_line("Cause: "+String(X509_verify_cert_error_string(X509_STORE_CTX_get_error(x509_ctx))));
+ ERR_print_errors_fp(stdout);
}
X509 *server_cert = X509_STORE_CTX_get_current_cert(x509_ctx);
@@ -361,7 +359,11 @@ Error StreamPeerOpenSSL::connect(Ref<StreamPeer> p_base, bool p_validate_certs,
// Same as before, try to connect.
int result = SSL_connect( ssl );
+
print_line("CONNECTION RESULT: "+itos(result));
+ if (result<1) {
+ _print_error(result);
+ }
X509 * peer = SSL_get_peer_certificate(ssl);
@@ -547,8 +549,10 @@ void StreamPeerOpenSSL::initialize_ssl() {
}
BIO_free(mem);
}
- print_line("Loaded certs: "+itos(certs.size()));
+ print_line("Loaded certs from '"+certs_path+"': "+itos(certs.size()));
}
+ String config_path =GLOBAL_DEF("ssl/config","");
+ Globals::get_singleton()->set_custom_property_info("ssl/config",PropertyInfo(Variant::STRING,"ssl/config",PROPERTY_HINT_FILE,"*.cnf"));
}