Index: src/SSLSocket.m ================================================================== --- src/SSLSocket.m +++ src/SSLSocket.m @@ -77,11 +77,15 @@ newWithClass: isa]; } SSL_set_connect_state(ssl); - if (SSL_connect(ssl) != 1) { + if ((privateKeyFile != nil && !SSL_use_PrivateKey_file(ssl, + [privateKeyFile cString], SSL_FILETYPE_PEM)) || + (certificateFile != nil && !SSL_use_certificate_file(ssl, + [certificateFile cString], SSL_FILETYPE_PEM)) || + SSL_connect(ssl) != 1) { close(sock); sock = INVALID_SOCKET; @throw [OFInitializationFailedException newWithClass: isa]; } @@ -120,11 +124,15 @@ port: port]; } SSL_set_connect_state(ssl); - if (SSL_connect(ssl) != 1) { + if ((privateKeyFile != nil && !SSL_use_PrivateKey_file(ssl, + [privateKeyFile cString], SSL_FILETYPE_PEM)) || + (certificateFile != nil && !SSL_use_certificate_file(ssl, + [certificateFile cString], SSL_FILETYPE_PEM)) || + SSL_connect(ssl) != 1) { [super close]; @throw [OFConnectionFailedException newWithClass: isa socket: self host: host port: port];