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];
|
self = [self init];
|
||||||
|
|
||||||
@try {
|
@try {
|
||||||
privateKeyFile = privateKeyFile_;
|
/* FIXME: Also allow with accepted sockets */
|
||||||
certificateFile = certificateFile_;
|
|
||||||
|
privateKeyFile = [privateKeyFile_ copy];
|
||||||
|
certificateFile = [certificateFile_ copy];
|
||||||
|
|
||||||
sock = dup(socket->sock);
|
sock = dup(socket->sock);
|
||||||
|
|
||||||
|
@ -366,6 +368,7 @@ ssl_locking_callback(int mode, int n, const char *file, int line)
|
||||||
- (X509Certificate*)peerCertificate
|
- (X509Certificate*)peerCertificate
|
||||||
{
|
{
|
||||||
X509 *certificate = SSL_get_peer_certificate(ssl);
|
X509 *certificate = SSL_get_peer_certificate(ssl);
|
||||||
|
|
||||||
if (!certificate)
|
if (!certificate)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
|
@ -376,8 +379,9 @@ ssl_locking_callback(int mode, int n, const char *file, int line)
|
||||||
- (void)verifyPeerCertificate
|
- (void)verifyPeerCertificate
|
||||||
{
|
{
|
||||||
unsigned long ret;
|
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);
|
const char *reason = X509_verify_cert_error_string(ret);
|
||||||
@throw [SSLInvalidCertificateException
|
@throw [SSLInvalidCertificateException
|
||||||
exceptionWithClass: isa
|
exceptionWithClass: isa
|
||||||
|
|
Reference in a new issue