Skip to content

Commit

Permalink
add support for unknown certificate error
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Vandriel committed Sep 19, 2016
1 parent 0469f7a commit 9dd461a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Change Log
### 0.7.3 (2016-09-19)

* Add support for Watch Kit certificates (DanielFontes)
* Add support for handshake error (certificate unknown)

### 0.7.2 (2016-07-19)

Expand Down
1 change: 1 addition & 0 deletions Classes/NWSSLConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ - (BOOL)handshakeSSLWithError:(NSError *__autoreleasing *)error
case errSSLServerAuthCompleted: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakeServerAuthCompleted error:error];
case errSSLPeerCertExpired: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakePeerCertExpired error:error];
case errSSLPeerCertRevoked: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakePeerCertRevoked error:error];
case errSSLPeerCertUnknown: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakePeerCertUnknown error:error];
#if !TARGET_OS_IPHONE
case errSecInDarkWake: return [NWErrorUtil noWithErrorCode:kNWErrorSSLInDarkWake error:error];
#endif
Expand Down
2 changes: 2 additions & 0 deletions Classes/NWType.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ typedef NS_ENUM(NSInteger, NWError) {
kNWErrorSSLHandshakePeerCertExpired = -229,
/** SSL handshake certificate revoked. */
kNWErrorSSLHandshakePeerCertRevoked = -230,
/** SSL handshake certificate unknown. */
kNWErrorSSLHandshakePeerCertUnknown = -233,
/** SSL handshake in dark wake. */
kNWErrorSSLInDarkWake = -231,
/** SSL handshake connection closed via error. */
Expand Down
1 change: 1 addition & 0 deletions Classes/NWType.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ + (NSString *)stringWithCode:(NWError)code
case kNWErrorSSLHandshakeServerAuthCompleted : return @"SSL handshake auth interrupted";
case kNWErrorSSLHandshakePeerCertExpired : return @"SSL handshake certificate expired";
case kNWErrorSSLHandshakePeerCertRevoked : return @"SSL handshake certificate revoked";
case kNWErrorSSLHandshakePeerCertUnknown : return @"SSL handshake certificate unknown";
case kNWErrorSSLInDarkWake : return @"SSL handshake in dark wake";
case kNWErrorSSLHandshakeClosedAbort : return @"SSL handshake connection closed via error";
case kNWErrorSSLHandshakeTimeout : return @"SSL handshake timeout";
Expand Down

0 comments on commit 9dd461a

Please sign in to comment.