Fix a missing copy.
This commit is contained in:
parent
38cd6bd401
commit
8ab05e111a
1 changed files with 12 additions and 8 deletions
|
@ -118,8 +118,10 @@ ssl_locking_callback(int mode, int n, const char *file, int line)
|
|||
self = [self init];
|
||||
|
||||
@try {
|
||||
privateKeyFile = privateKeyFile_;
|
||||
certificateFile = certificateFile_;
|
||||
/* FIXME: Also allow with accepted sockets */
|
||||
|
||||
privateKeyFile = [privateKeyFile_ copy];
|
||||
certificateFile = [certificateFile_ copy];
|
||||
|
||||
sock = dup(socket->sock);
|
||||
|
||||
|
@ -366,6 +368,7 @@ ssl_locking_callback(int mode, int n, const char *file, int line)
|
|||
- (X509Certificate*)peerCertificate
|
||||
{
|
||||
X509 *certificate = SSL_get_peer_certificate(ssl);
|
||||
|
||||
if (!certificate)
|
||||
return nil;
|
||||
|
||||
|
@ -376,8 +379,9 @@ ssl_locking_callback(int mode, int n, const char *file, int line)
|
|||
- (void)verifyPeerCertificate
|
||||
{
|
||||
unsigned long ret;
|
||||
if ((SSL_get_peer_certificate(ssl) == NULL)
|
||||
|| ((ret = SSL_get_verify_result(ssl)) != X509_V_OK)) {
|
||||
|
||||
if ((SSL_get_peer_certificate(ssl) == NULL) ||
|
||||
((ret = SSL_get_verify_result(ssl)) != X509_V_OK)) {
|
||||
const char *reason = X509_verify_cert_error_string(ret);
|
||||
@throw [SSLInvalidCertificateException
|
||||
exceptionWithClass: isa
|
||||
|
|
Reference in a new issue