OLD | NEW |
1 // | 1 // |
2 // Copyright 2012 Square Inc. | 2 // Copyright 2012 Square Inc. |
3 // | 3 // |
4 // Licensed under the Apache License, Version 2.0 (the "License"); | 4 // Licensed under the Apache License, Version 2.0 (the "License"); |
5 // you may not use this file except in compliance with the License. | 5 // you may not use this file except in compliance with the License. |
6 // You may obtain a copy of the License at | 6 // You may obtain a copy of the License at |
7 // | 7 // |
8 // http://www.apache.org/licenses/LICENSE-2.0 | 8 // http://www.apache.org/licenses/LICENSE-2.0 |
9 // | 9 // |
10 // Unless required by applicable law or agreed to in writing, software | 10 // Unless required by applicable law or agreed to in writing, software |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 if (_secure) { | 562 if (_secure) { |
563 NSMutableDictionary *SSLOptions = [[NSMutableDictionary alloc] init]; | 563 NSMutableDictionary *SSLOptions = [[NSMutableDictionary alloc] init]; |
564 | 564 |
565 [_outputStream setProperty:(__bridge id)kCFStreamSocketSecurityLevelNego
tiatedSSL forKey:(__bridge id)kCFStreamPropertySocketSecurityLevel]; | 565 [_outputStream setProperty:(__bridge id)kCFStreamSocketSecurityLevelNego
tiatedSSL forKey:(__bridge id)kCFStreamPropertySocketSecurityLevel]; |
566 | 566 |
567 // If we're using pinned certs, don't validate the certificate chain | 567 // If we're using pinned certs, don't validate the certificate chain |
568 if ([_urlRequest SR_SSLPinnedCertificates].count) { | 568 if ([_urlRequest SR_SSLPinnedCertificates].count) { |
569 [SSLOptions setValue:[NSNumber numberWithBool:NO] forKey:(__bridge i
d)kCFStreamSSLValidatesCertificateChain]; | 569 [SSLOptions setValue:[NSNumber numberWithBool:NO] forKey:(__bridge i
d)kCFStreamSSLValidatesCertificateChain]; |
570 } | 570 } |
571 | 571 |
572 #if DEBUG | 572 #ifdef DEBUG |
573 [SSLOptions setValue:[NSNumber numberWithBool:NO] forKey:(__bridge id)kC
FStreamSSLValidatesCertificateChain]; | 573 [SSLOptions setValue:[NSNumber numberWithBool:NO] forKey:(__bridge id)kC
FStreamSSLValidatesCertificateChain]; |
574 NSLog(@"SocketRocket: In debug mode. Allowing connection to any root ce
rt"); | 574 NSLog(@"SocketRocket: In debug mode. Allowing connection to any root ce
rt"); |
575 #endif | 575 #endif |
576 | 576 |
577 [_outputStream setProperty:SSLOptions | 577 [_outputStream setProperty:SSLOptions |
578 forKey:(__bridge id)kCFStreamPropertySSLSettings]; | 578 forKey:(__bridge id)kCFStreamPropertySSLSettings]; |
579 } | 579 } |
580 | 580 |
581 _inputStream.delegate = self; | 581 _inputStream.delegate = self; |
582 _outputStream.delegate = self; | 582 _outputStream.delegate = self; |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 } | 1752 } |
1753 } | 1753 } |
1754 | 1754 |
1755 - (NSRunLoop *)runLoop; | 1755 - (NSRunLoop *)runLoop; |
1756 { | 1756 { |
1757 dispatch_group_wait(_waitGroup, DISPATCH_TIME_FOREVER); | 1757 dispatch_group_wait(_waitGroup, DISPATCH_TIME_FOREVER); |
1758 return _runLoop; | 1758 return _runLoop; |
1759 } | 1759 } |
1760 | 1760 |
1761 @end | 1761 @end |
OLD | NEW |