E
E
Egor Petrov2015-05-04 10:26:31
linux
Egor Petrov, 2015-05-04 10:26:31

How to use the certificate generated in windows in linux?

Good afternoon. I'm trying to establish a connection to a single SOAP service using PHP on Ubuntu 14.10. What was done:
A fragment of the documentation:

Creating and configuring certificates
To create a certificate yourself, do the following:
1. Run the following command to create a certificate:
makecert.exe -n "CN=name" -ss My -r -m 120 -pe -sky exchange -a sha1
2. С Using the Certificates snap-in, export the generated certificate to a .cer file and send it to the address provided by the technical support service.
3. Using the Certificates snap-in, import the certificate file into Trusted people.

I now have this pair of *.cer certificates. My difficulty is figuring out how to use these certificates. I tried to create a standard SoapClient by specifying in the settings the certificate sent to me converted to pem-format, the connection silently falls off by timeout.
I tried to send a request using curl without a soap client, then an error was already returned about the signature and security. As far as I remember (I’ve been fighting for a long time), I took the certificate generated on our side in Windows, extracted the public and private keys from it in pem format, specified them in the curl settings using CURLOPT_SSH_PUBLIC_KEYFILE and CURLOPT_SSH_PRIVATE_KEYFILE, specified the certificate sent by the technical support of the service in pem format using CURLOPT_SSLCERT, but still the same error.
Previously, I had to work only with certificates from crypto, but there, in addition to the certificates, six more key files were sent and I had to change the library in order to use the cryptopro curl, but as I understand it, this is not the case here.
In general, as I understand it, to connect you need to use the public and private key of the machine for which the certificate was generated, after all, it confirms only a couple of this machine?
I also tried to run the script by gaining access to the Windows machine in which the certificate was generated, having previously added it to the trusted ones using the snap-in, but I got the same errors about signature and security. "An error occurred when verifying security for the message."
Please direct me to the right path.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
justabaka, 2015-05-15
@justabaka

And what is the second .cer file turned out to be, isn't it ca.cer, by any chance? CER converts easily to CRT: stackoverflow.com/a/5478901
Let's say that using wget with key authentication requires the following:
* CA certificate to validate the server's certificate (usually ca.crt);
* client.crt - client certificate (public key);
* client.pem (.key) - client private key

E
EminH, 2015-05-14
@EminH

Download openssl for windows and convert to the required format
Or use the online converter
https://www.sslshopper.com/ssl-converter.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question