Index: src/SSLSocket.m ================================================================== --- src/SSLSocket.m +++ src/SSLSocket.m @@ -1,7 +1,8 @@ /* - * Copyright (c) 2011, 2012, 2013, 2014, Jonathan Schleifer + * Copyright (c) 2011, 2012, 2013, 2014, 2015 + * Jonathan Schleifer * Copyright (c) 2011, Florian Zeitz * Copyright (c) 2011, Jos Kuijpers * * https://webkeks.org/git/?p=objopenssl.git * @@ -30,19 +31,21 @@ #include #import #import #import +#import #import #import #import #import #import #import #import #import + #import #import #import "SSLSocket.h" #import "SSLInvalidCertificateException.h" @@ -147,11 +150,11 @@ socket: self]; } SSL_set_connect_state(_SSL); - encoding = [OFString nativeOSEncoding]; + encoding = [OFSystemInfo native8BitEncoding]; if ((_privateKeyFile != nil && !SSL_use_PrivateKey_file(_SSL, [_privateKeyFile cStringWithEncoding: encoding], SSL_FILETYPE_PEM)) || (_certificateFile != nil && !SSL_use_certificate_file(_SSL, [_certificateFile @@ -188,11 +191,12 @@ if (_requestsClientCertificates) SSL_set_verify(client->_SSL, SSL_VERIFY_PEER, NULL); SSL_set_accept_state(client->_SSL); - encoding = [OFString nativeOSEncoding]; + encoding = [OFSystemInfo native8BitEncoding]; + if (!SSL_use_PrivateKey_file(client->_SSL, [_privateKeyFile cStringWithEncoding: encoding], SSL_FILETYPE_PEM) || !SSL_use_certificate_file(client->_SSL, [_certificateFile cStringWithEncoding: encoding], SSL_FILETYPE_PEM) || SSL_accept(client->_SSL) != 1) {