Index: src/SSLSocket.m ================================================================== --- src/SSLSocket.m +++ src/SSLSocket.m @@ -135,10 +135,11 @@ SSL_free(SSL_); } - (void)startTLS { + of_string_encoding_t encoding = [OFString nativeOSEncoding]; if ((_SSL = SSL_new(ctx)) == NULL || !SSL_set_fd(_SSL, _socket)) { [super close]; @throw [OFConnectionFailedException exceptionWithHost: nil port: 0 @@ -146,14 +147,14 @@ } SSL_set_connect_state(_SSL); if ((_privateKeyFile != nil && !SSL_use_PrivateKey_file(_SSL, - [_privateKeyFile cStringWithEncoding: OF_STRING_ENCODING_NATIVE], + [_privateKeyFile cStringWithEncoding: encoding], SSL_FILETYPE_PEM)) || (_certificateFile != nil && !SSL_use_certificate_file(_SSL, [_certificateFile - cStringWithEncoding: OF_STRING_ENCODING_NATIVE], + cStringWithEncoding: encoding], SSL_FILETYPE_PEM)) || SSL_connect(_SSL) != 1) { [super close]; @throw [OFConnectionFailedException exceptionWithHost: nil port: 0 @@ -170,10 +171,11 @@ [self startTLS]; } - (instancetype)accept { + of_string_encoding_t encoding = [OFString nativeOSEncoding]; SSLSocket *client = (SSLSocket*)[super accept]; if ((client->_SSL = SSL_new(ctx)) == NULL || !SSL_set_fd(client->_SSL, client->_socket)) { [client SSL_super_close]; @@ -184,13 +186,13 @@ SSL_set_verify(client->_SSL, SSL_VERIFY_PEER, NULL); SSL_set_accept_state(client->_SSL); if (!SSL_use_PrivateKey_file(client->_SSL, [_privateKeyFile - cStringWithEncoding: OF_STRING_ENCODING_NATIVE], + cStringWithEncoding: encoding], SSL_FILETYPE_PEM) || !SSL_use_certificate_file(client->_SSL, - [_certificateFile cStringWithEncoding: OF_STRING_ENCODING_NATIVE], + [_certificateFile cStringWithEncoding: encoding], SSL_FILETYPE_PEM) || SSL_accept(client->_SSL) != 1) { [client SSL_super_close]; @throw [OFAcceptFailedException exceptionWithSocket: self]; }