File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 60
60
///
61
61
/// - Parameter queue: Dispatch queue to run `sec_protocol_options_set_verify_block` on.
62
62
/// - Returns: Equivalent NWProtocolTLS Options
63
- func getNWProtocolTLSOptions( ) -> NWProtocolTLS . Options {
63
+ func getNWProtocolTLSOptions( ) throws -> NWProtocolTLS . Options {
64
64
let options = NWProtocolTLS . Options ( )
65
65
66
66
// minimum TLS protocol
113
113
var secTrustRoots : [ SecCertificate ] ?
114
114
switch trustRoots {
115
115
case . some( . certificates( let certificates) ) :
116
- do {
117
- secTrustRoots = try certificates. compactMap { certificate in
118
- try SecCertificateCreateWithData ( nil , Data ( certificate. toDERBytes ( ) ) as CFData )
119
- }
120
- } catch {
121
- // failed to load
116
+ secTrustRoots = try certificates. compactMap { certificate in
117
+ try SecCertificateCreateWithData ( nil , Data ( certificate. toDERBytes ( ) ) as CFData )
122
118
}
123
119
case . some( . file) :
124
120
preconditionFailure ( " TLSConfiguration.trustRoots.file is not supported " )
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ extension NIOClientTCPBootstrap {
89
89
} else {
90
90
// create NIOClientTCPBootstrap with NIOTS TLS provider
91
91
let tlsConfiguration = configuration. tlsConfiguration ?? TLSConfiguration . forClient ( )
92
- let parameters = tlsConfiguration. getNWProtocolTLSOptions ( )
92
+ let parameters = try tlsConfiguration. getNWProtocolTLSOptions ( )
93
93
let tlsProvider = NIOTSClientTLSProvider ( tlsOptions: parameters)
94
94
bootstrap = NIOClientTCPBootstrap ( tsBootstrap, tls: tlsProvider)
95
95
}
You can’t perform that action at this time.
0 commit comments