Closed velis74 closed 7 years ago
An additional remark: on the certificate generation page (right at the bottom), there's a warning:
Intermediate Certificates
To use your certificates, you must have the intermediate signing certificate in your system keychain. This is automatically installed by Xcode. However, if you need to reinstall the intermediate signing certificate click the link below:
Worldwide Developer Relations Certificate Authority
I have tried to use this certificate, by manually creating CertificateCredentials:
cred = CertificateCredentials(os.path.join(settings.BASE_DIR, 'ScantronServer', 'ios.cer'),
cert_chain=os.path.join(settings.BASE_DIR, 'ScantronServer', 'AppleWWDRCA.cer'))
but this fails before the "chain" file would be parsed because it first tries to initialise the chain from client certificate.
I also imported this certificate into my computer's certificate store (the Windows one), but that doesn't seem to have any effect.
OK, found out what the problem was: The generated certificate has to be imported into keystore of the computer that generated the .csr. During this import, the private key is supposed to attach to the certificate. Then simply export the certificate into .p12 and finally convert to .pem
openssl pkcs12 -in /path/to/p12/certificate -out /path/to/pem/certificate/export/location -nodes -clcerts
I'm trying to establish this functionality, but failing miserably in certificate initialisation phase:
I have generated a "VoIP Services" certificate. Downloaded it comes in .cer format. I convert it to .pem using OpenSSL:
openssl x509 -inform der -in ios.cer -out ios.pem
Whichever of these two certificates I try to use:
I get a similar error: ssl.SSLError: [SSL] PEM lib (_ssl.c:3288) --> for .cer ssl.SSLError: [SSL] PEM lib (_ssl.c:3309) --> for .pem
The way I see it after much debugging is that the issue is in library trying to validate the entire certificate chain, which it does not have.
Am I generating a wrong certificate type / converting it incorrectly?