I have a GoDaddy-issued SSL certificate in the .crt
format. Also I have the previous expired certificate in the .pfx
format which includes a private key.
Now I'm facing the problem of joining the original private key with the issued certificate to form a .pfx
file suitable for installation into the Windows certificate store.
I followed steps that I used successfuly in a similar situation for producing a code signing certificate (documented in this Q/A pair on SO). The resulting certificate works for HTTPS, but not for WCF's Net.Tcp endpoints. When such endpoint is used, it fails to initialize due to the following error:
ArgumentException: It is likely that certificate 'CN=domain.com, O="Company", L=Abc, S=Abc, C=XY' may not have a private key that is capable of key exchange or the process may not have access rights for the private key. Please see inner exception for detail.
Some sources claim that it's necessary to use www.domain.com
instead of domain.com
. While this can be the issue in some cases, it proved not to be the root cause in my case.
What can be the root cause of this problem and how to get it fixed?
Assign the existing private key to a new certificateSign in to the computer that issued the certificate request by using an account that has administrative permissions. Select Start, select Run, type mmc, and then select OK. On the File menu, select Add/Remove Snap-in. In the Add/Remove Snap-in dialog box, select Add.
crt does not show a private key and cannot be used for SSL.
In Internet Information Services (IIS) Manager, under Connections, expand your server's name, expand Sites, and then select the website on which you want to install the SSL Certificate. In the Actions menu, under Edit Site, click Bindings. In the Site Bindings window, select binding for https and then, click Edit.
The problem is the certificate created from a .spc
as an intermediary format, as resulting from following the steps in this answer, leads to loss of the KeyExchange
flag.
The correct way to join the .crt
with a private key is to use a private key in the .pem
format, like this:
Ssl.crt
certificate from GoDaddy.Export a PEM-formatted private key from the expired PFX:
openssl.exe pkcs12 -in ExpiredSslCert.pfx -nocerts -out SslPrivateKey.pem
Combine the CRT and PEM into PFX:
openssl.exe pkcs12 -export -in SslCert.crt -inkey SslPrivateKey.pem -out FullCert.pfx
The resulting .pfx
now has the KeyExchange
flag and works for WCF Net.Tcp bindings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With