Make it possible to require TLS.

This commit is contained in:
Jonathan Schleifer 2011-09-14 22:09:46 +02:00
parent 7c35be965c
commit 616aa8b9cd
2 changed files with 28 additions and 1 deletions

View file

@ -329,6 +329,16 @@
return [[sock retain] autorelease];
}
- (BOOL)encryptionRequired
{
return encryptionRequired;
}
- (void)setEncryptionRequired: (BOOL)required
{
encryptionRequired = required;
}
- (BOOL)encrypted
{
return encrypted;
@ -711,6 +721,10 @@
return;
}
if (encryptionRequired && !encrypted)
/* TODO: Find/create an exception to throw here */
@throw [OFException newWithClass: isa];
if (mechs != nil) {
OFEnumerator *enumerator;
OFXMLElement *mech;