girishPC / unitt

Automatically exported from code.google.com/p/unitt
0 stars 0 forks source link

WSS tlssettings #47

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
what are the steps required to establish a websocket connection using 
wss(secure).

I have used the following snippet of code

    NSMutableDictionary *tlsSettings = [NSMutableDictionary dictionaryWithCapacity:4];
    [tlsSettings setObject:url.host forKey:(NSString *)kCFStreamSSLPeerName];

   [tlsSettings setObject:[NSNumber numberWithBool:YES]
                    forKey:(NSString *)kCFStreamSSLAllowsExpiredCertificates];

     [tlsSettings setObject:[NSNumber numberWithBool:YES]
                    forKey:(NSString *)kCFStreamSSLAllowsAnyRoot];

    [tlsSettings setObject:[NSNumber numberWithBool:NO]
                    forKey:(NSString *)kCFStreamSSLValidatesCertificateChain];

    WebSocketConnectConfig *config = [WebSocketConnectConfig configWithURLString:aURl origin:origin protocols:[NSArray  arrayWithObject:wsSubprotocol] tlsSettings:tlsSettings headers:nil verifySecurityKey:YES extensions:nil];

WHen I use this from the simulator or the device I get the following error 
message

Error: errorDesc=The operation couldn’t be completed. 
(kCFStreamErrorDomainSSL error -9807.), failureReason=(null)

Any thoughts on how to configure a secure websocket would be great.

Cheers.

Original issue reported on code.google.com by vikas.ra...@gmail.com on 26 Jun 2012 at 2:27

GoogleCodeExporter commented 8 years ago
I found the error. The delegate method has changed in versions. Look for an 
update real soon.

Original comment by joshuadmorris@gmail.com on 4 Jul 2012 at 3:55

GoogleCodeExporter commented 8 years ago
It is now fixed in the trunk. Can you verify that this addresses your issue?

Original comment by joshuadmorris@gmail.com on 6 Jul 2012 at 5:57

GoogleCodeExporter commented 8 years ago
Thank you josh, that fixed the issue.

Original comment by vikas.ra...@gmail.com on 25 Jul 2012 at 11:47