when I perform the following

                 openssl s_client -connect

I get the Server certificate as:

                 -----BEGIN CERTIFICATE-----
                 MIICSTCCAbKgAwIBAgIESfnb7zANBgkqhkiG9w0BAQUFADBpMQswCQYDVQQGEwJJ ….

[1] From which destination does the machine take the "CERTIFICATE" with running the command "openssl s_client -connect" ? , how can I learn from that about the server key or how to create the server key?

[2] There is a command that creates new CRT and KEY that after it the MD5 shows they FIT: openssl req -new -x509 -nodes -out server.crt -keyout server.key

[3] The question:there is a command who can convert server.crt file to server.key file ? because I know the "CERTIFICATE" and need to find his KEY (server.key).

  • my default server key PATH:…./Apache/Apache/conf/ssl.key/server.key
  1. The certificate s_client is printing out is the server's public key. The PKI (known to http servers as the "SSL Certificate") works by matched pairs of keys, on public and the other private.

  2. Public certificates (usually .CRT files) cannot be used to generate matching private keys (usually .KEY files); the system is specifically designed this way.

Your question is quite hard to understand, and you seem to have some misconceptions about PKI. Perhaps you could ask the question you're getting at; for instance, are you trying to configure a HTTPS server, or something similar?

  • From which destination does the machine take the "CERTIFICATE" ? from file or somthing else?
    – David
    Jul 20 '11 at 12:26
  • after I get the "CERTIFICATE" key - how to find from this the server key??
    – David
    Jul 20 '11 at 12:28
  • The certificate is transmitted over the connected from the server to the client. Checking Apache's configuration is going to be the quickest way to find the server's key.
    – Chris S
    Jul 20 '11 at 12:31
  • ok but how to find the server key from Apache configuration?
    – David
    Jul 20 '11 at 12:33
  • 1
    @David, somewhere in the Apache configuration (text file(s)) it says SSLCertificateKeyFile /path/to/some/file, that's the key file. You can not get a key from a public certificate, I already covered that one.
    – Chris S
    Jul 20 '11 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.