Я создаю свой самозаверяющий ключ SSL и сохраняю его таким образом
Файл «sub.conf»
Код: Выделить всё
[req]
default_bits = 4096
prompt = no
default_md = sha256
x509_extensions = v3_req
distinguished_name = dn
[dn]
C = IN
ST = MAH
L = PUNE
O = JAM
emailAddress = Domino.Admin@jam.com
CN = it+
[v3_req]
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
Код: Выделить всё
"# Non-interactive and 10 years expiration"
> openssl -x509 -newkey rsa:4096 -sha256 -nodes -keyout "\key.pem" -days 3560 -out "crt.pem" -config "sub.conf"
"# > create the keystore"
> openssl pkcs12 -inkey key.pem -in crt.pem -export -out myapp.p12;
"# > create the truststore"
> keytool -importkeystore -srckeystore myapp.p12 -srcstoretype pkcs12 -destkeystore myapp.jks -deststoretype JKS
Код: Выделить всё
# ==============================================================
# = Authentication Server JWT
# ==============================================================
server:
port: 9100
ssl:
enabled: true
trust-store: E:\myapp.p12 # The path to the keystore containing the certificate
trust-store-password:
trust-store-type: PKCS12
bundle: "mybundle"
spring:
application:
name: AUTH-SERVICE
ssl:
bundle:
pem:
mybundle:
keystore:
certificate: "/crt.pem"
private-key: "/key.pem"
truststore:
certificate: "/crt.pem"
Код: Выделить всё
server:
port: 5000
ssl:
enabled: true
key-store: E:\myapp.p12 # The path to the keystore containing the certificate
key-store-password:
key-store-type: PKCS12
trust-store: E:\myapp.jks # The path to the keystore containing the certificate
trust-store-password:
trust-store-type: jks
bundle: "mybundle"
spring:
application:
name: GestUser
ssl:
bundle:
pem:
mybundle:
keystore:
certificate: "/crt.pem"
private-key: "/key.pem"
truststore:
certificate: "/crt.pem"
"o.s.security.web.FilterChainProxy: Защита GET /api/utenti/cerca/userid/anonymous
o.a.tomcat.util.net.jsse.JSSESupport: Ошибка при попытке получить сертификат от клиента
Код: Выделить всё
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
Подробнее здесь: https://stackoverflow.com/questions/798 ... -not-authe
Мобильная версия