Spring Cloud Gateway 配置HTTPS
server:
ssl:
enabled: true
key-alias: scg #证书的别名
key-store-password: scg1234 #证书的密码
key-store: classpath:xxxxx.p12 #证书的位置
key-store-type: PKCS12 #证书的类型
但是这里要注意的是按照官网给的配置打开SSL,通过https访问会报错:io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: no cipher suites in common
解决方法:把key-alias: scg这行删除或注释掉即可
ssl:
enabled: true
# key-alias: scg
key-store: classpath:xxxxxx.pfx
key-store-password: izdjd1rL
key-store-type: PKCS12
这时候还会报错:io.netty.handler.codec.DecoderException: javax.net.ssl.SSLException: Received fatal alert: certificate_unknown
这个时候就可以无视这个错误了。如果还想不报这个错误您可以去深入的研究是什么原因造成的,当然作者我也希望您将这个问题解决后可以告诉我一下