mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Ssl tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11344 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d85ea9ba47
commit
288c0b6e9d
5 changed files with 705 additions and 568 deletions
|
@ -1,7 +1,9 @@
|
|||
2001-11-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSHTTPHURLHandle.m: handle writing of nil properties and
|
||||
use of empty strings as proxy settings.
|
||||
use of empty strings as proxy settings. Minimise delays when
|
||||
tunneling SSL
|
||||
* Source/UnixFileHandle.m: Improve error logging with ssl.
|
||||
|
||||
2001-11-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
|
|
|
@ -384,6 +384,8 @@ static NSLock *urlLock = nil;
|
|||
{
|
||||
NSRunLoop *loop = [NSRunLoop currentRunLoop];
|
||||
NSString *cmd;
|
||||
NSTimeInterval last = 0.0;
|
||||
NSTimeInterval limit = 0.01;
|
||||
|
||||
if ([url port] == nil)
|
||||
{
|
||||
|
@ -406,7 +408,14 @@ static NSLock *urlLock = nil;
|
|||
object: sock];
|
||||
while (tunnel == YES)
|
||||
{
|
||||
[loop runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 1.0]];
|
||||
NSDate *when;
|
||||
NSTimeInterval tmp = limit;
|
||||
|
||||
limit += last;
|
||||
last = tmp;
|
||||
when = [[NSDate alloc] initWithTimeIntervalSinceNow: limit];
|
||||
[loop runUntilDate: when];
|
||||
RELEASE(when);
|
||||
}
|
||||
}
|
||||
if ([[url scheme] isEqualToString: @"https"])
|
||||
|
@ -533,6 +542,7 @@ static NSLock *urlLock = nil;
|
|||
e = [userInfo objectForKey: GSFileHandleNotificationError];
|
||||
if (e != nil)
|
||||
{
|
||||
tunnel = NO;
|
||||
NSLog(@"Failed to write command to socket - %@", e);
|
||||
/*
|
||||
* Tell superclass that the load failed - let it do housekeeping.
|
||||
|
|
|
@ -1980,34 +1980,37 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
//NSLog(@"Number of attempts: %d", count);
|
||||
if (err != SSL_ERROR_NONE)
|
||||
{
|
||||
NSLog(@"unable to make SSL connection");
|
||||
NSString *err;
|
||||
|
||||
switch (SSL_get_error(ssl, ret))
|
||||
{
|
||||
case SSL_ERROR_NONE:
|
||||
NSLog(@"No error: really helpful");
|
||||
err = @"No error: really helpful";
|
||||
break;
|
||||
case SSL_ERROR_ZERO_RETURN:
|
||||
NSLog(@"Zero Return error");
|
||||
err = @"Zero Return error";
|
||||
break;
|
||||
case SSL_ERROR_WANT_READ:
|
||||
NSLog(@"Want Read Error");
|
||||
err = @"Want Read Error";
|
||||
break;
|
||||
case SSL_ERROR_WANT_WRITE:
|
||||
NSLog(@"Want Write Error");
|
||||
err = @"Want Write Error";
|
||||
break;
|
||||
case SSL_ERROR_WANT_X509_LOOKUP:
|
||||
NSLog(@"Want X509 Lookup Error");
|
||||
err = @"Want X509 Lookup Error";
|
||||
break;
|
||||
case SSL_ERROR_SYSCALL:
|
||||
NSLog(@"Syscall Error - %s", GSLastErrorStr(errno));
|
||||
err = @"Syscall Error - %s", GSLastErrorStr(errno);
|
||||
break;
|
||||
case SSL_ERROR_SSL:
|
||||
NSLog(@"SSL Error: really helpful");
|
||||
err = @"SSL Error: really helpful";
|
||||
break;
|
||||
default:
|
||||
NSLog(@"Standard Unix Error: really helpful");
|
||||
err = @"Standard Unix Error: really helpful";
|
||||
break;
|
||||
}
|
||||
NSLog(@"unable to make SSL connection to %@:%@ - %@",
|
||||
address, service, err);
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
|
11
configure.in
11
configure.in
|
@ -887,15 +887,24 @@ if test $enable_openssl = yes; then
|
|||
LIBS="$LIBS -lcrypto"
|
||||
AC_CHECK_LIB(ssl, ssl2_clear, ssl_ok=yes, ssl_ok=no)
|
||||
if test "$ssl_ok" = yes; then
|
||||
echo "found openssl"
|
||||
LIBS="$base_libs -lssl -lcrypto"
|
||||
AC_DEFINE(HAVE_OPENSSL)
|
||||
else
|
||||
echo "Could not find openssl crypto library"
|
||||
echo "Check to make sure you have a recent version of openssl installed"
|
||||
AC_MSG_WARN(Could not find openssl headers)
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(cipher,des_setkey,cipher_ok=yes,cipher_ok=no)
|
||||
if test "$cipher_ok" = yes; then
|
||||
echo "found cipher"
|
||||
LIBS="$LIBS -lcipher"
|
||||
fi
|
||||
|
||||
else
|
||||
echo "Could not find openssl library"
|
||||
echo "Check to make sure you have a recent version of openssl installed"
|
||||
AC_MSG_WARN(Could not find openssl headers)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue