Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket error: PKCS12 file not specified. #97

Open
SodaSurfer opened this issue Jan 22, 2022 · 1 comment
Open

Socket error: PKCS12 file not specified. #97

SodaSurfer opened this issue Jan 22, 2022 · 1 comment

Comments

@SodaSurfer
Copy link

Hi there

I'm trying to connect and create an ssl socket using the following code snippet:
let fileCertURL = Bundle.main.url(forResource:"cert", withExtension: "pem")?.path
let fileKeyURL = Bundle.main.url(forResource:"key", withExtension: "pem")?.path
let myConfig = SSLService.Configuration(withCACertificateFilePath: nil, usingCertificateFile: fileCertURL, withKeyFile: fileKeyURL, usingSelfSignedCerts: true, cipherSuite: nil)
var socket = try Socket.create()
socket.delegate = try SSLService(usingConfiguration: myConfig)
try socket.connect(to: "******", port: ****)

But I keep getting this error:
ERROR: Socket error: PKCS12 file not specified.

I am running this code on my actual iPhone device (not macOS) and by the documentation it doesn't says that I need to add a .pkcs12 file anywhere

any help is appreciated

@Nahatakyan
Copy link

Try to create certificate with this instruction and use that certificate
https://www.ibm.com/docs/en/api-connect/10.0.1.x?topic=overview-generating-self-signed-certificate-using-openssl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants