-Fixes to OpenSSL compilation (more)

-Fix bug in GDScript, now static functions can call static functions.
This commit is contained in:
Juan Linietsky
2014-05-01 11:34:10 -03:00
parent 4dc4e96c8a
commit 6572d51288
9 changed files with 55 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
#include "register_openssl.h"
#include "stream_peer_openssl.h"
#ifdef OPENSSL_ENABLED
void register_openssl() {
@@ -14,3 +15,5 @@ void unregister_openssl() {
StreamPeerOpenSSL::finalize_ssl();
}
#endif

View File

@@ -553,6 +553,25 @@ void StreamPeerOpenSSL::initialize_ssl() {
}
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"));
if (config_path!="") {
Vector<uint8_t> data = FileAccess::get_file_as_array(config_path);
if (data.size()) {
data.push_back(0);
BIO* mem = BIO_new(BIO_s_mem());
BIO_puts(mem,(const char*) data.ptr());
while(true) {
X509*cert = PEM_read_bio_X509(mem, NULL, 0, NULL);
if (!cert)
break;
certs.push_back(cert);
}
BIO_free(mem);
}
print_line("Loaded certs from '"+certs_path+"': "+itos(certs.size()));
}
}