[英]Is there a way to get a certificate for spring boot API to convert from http to https other than self signed certificates?
I use Spring boot for my API and I tried enabling https for my application with a Self signed certificate but while accessing that firefox and chrome showed warnings saying
Warning: Potential Security Risk Ahead with MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT
and flutter,postman show this too so i reverted back to http, So is there a way to get a https certificate for my spring boot application?
这里有两种可能
如果您属于 #1 - 我建议您从任何供应商处购买适当的证书并将其安装在 tomcat 级别,以便您的所有微服务都可以使用它。 我从letsencrypt获得了3个月的免费证书并做了同样的事情。 但是,安装可能非常痛苦,因为您必须将这些证书转换为 JVM 支持的格式等。
如果您属于 #2 - 我建议您使用反向代理服务,例如 cloudflare。 它非常容易配置。 此外,cloudflare 发布的 SSL 将是免费的。
即您从客户端到 cloudflare 的流量将受到保护并具有 SSL 锁定。 但是,从 cloudflare 到您的服务器的流量将是 HTTP。
如果您正在寻找一种免费的方式来获取 https 证书并为您的端点启用 https,您可以通过多种方式来执行此操作。
当您向我们购买或转让域名时,您将获得包括以下所有功能:
- 免费域名保护和 WHOIS 隐私,5 个 Email 转发
- 如果您还在 Cloud CMS 上托管您的网站,则可免费获得 SSL 证书
- 简单的 DNS 编辑器来管理您的 DNS 条目(A、CNAME、MX,...),配置名称服务器、域所有者、续订选项
application.properties
轻松将其添加到 springboot如下所示。 阅读 指南。应用程序属性
server.port=8443
security.require-ssl=true
server.ssl.key-store=/etc/letsencrypt/live/example.com/keystore.p12
server.ssl.key-store-password=<your-password>
server.ssl.keyStoreType=PKCS12
server.ssl.keyAlias=tomcat
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.