How to add subject alernative name to ssl certs?

前端 未结 3 362
情歌与酒
情歌与酒 2020-11-29 00:16

I\'m using openssl to create self-signed certs. I\'m getting this error with the certs I generated:

javax.net.ssl.SSLHandshakeException: ja

3条回答
  •  庸人自扰
    2020-11-29 01:01

    Although this question was more specifically about IP addresses in Subject Alt. Names, the commands are similar (using DNS entries for a host name and IP entries for IP addresses).

    To quote myself:

    If you're using keytool, as of Java 7, keytool has an option to include a Subject Alternative Name (see the table in the documentation for -ext): you could use -ext san=dns:www.example.com or -ext san=ip:10.0.0.1

    Note that you only need Java 7's keytool to use this command. Once you've prepared your keystore, it should work with previous versions of Java.

    (The rest of this answer also mentions how to do this with OpenSSL, but it doesn't seem to be what you're using.)

提交回复
热议问题