Pregunta

I'm attempting to follow the instructions on this page: http://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/ to create a certificate for my localhost in which to do some development testing.

When running InstallCert for localhost:8443, the following two certificates are generated:

Server sent 2 certificate(s):

1 Subject CN=localhost4.localdomain4, O=example.com, C=US Issuer CN=Certificate Shack, O=example.com, C=US sha1 f4 2a a9 09 32 a6 ee 41 9d 9c 44 e6 4a bc 31 79 17 cb 88 fd md5 e0 78 65 83 30 33 78 c5 80 17 e7 7a a2 91 85 52

2 Subject CN=Certificate Shack, O=example.com, C=US Issuer CN=Certificate Shack, O=example.com, C=US sha1 b8 87 d6 2d ac d8 36 06 7c 58 68 10 3e 21 39 6a a0 33 a1 25 md5 07 24 57 5f f8 35 1e 97 70 ff 54 aa 13 e6 6b 12

The trouble is that my system needs the CN to be localhost. I have no idea where the localhost4.localdomain4 comes from. How can I change this to be simply localhost?

¿Fue útil?

Solución

  1. The certificate comes from the server, during the handshake.
  2. The CN is inside the certificate.
  3. You can't change it without creating a new server certificate.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top