File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -196,5 +196,23 @@ public class ScClient : Listener, WebSocketDelegate {
196196 public func disableSSLVerification( value : Bool ) {
197197 socket. disableSSLCertValidation = value
198198 }
199+
200+ /**
201+ Uses the .cer files in your app's bundle
202+ */
203+ public func useSSLCertificate( ) {
204+ socket. security = SSLSecurity ( )
205+ }
206+
207+ /**
208+ You load either a Data blob of your certificate or you can use a SecKeyRef if you have a public key you want to use.
209+ - Parameters:
210+ - data: Data blob of your certificate.
211+ - usePublicKeys: The usePublicKeys bool is whether to use the certificates for validation or the public keys.
212+ */
213+ public func loadSSLCertificateFromData( data : Data , usePublicKeys : Bool = false ) {
214+ socket. security = SSLSecurity ( certs: [ SSLCert ( data: data) ] , usePublicKeys: usePublicKeys)
215+ }
216+
199217}
200218
You can’t perform that action at this time.
0 commit comments