问题描述
我正在创建一些宁静的Web服务,并使用Spring-Boot创建一个嵌入式tomcat容器。
I'm creating some restful web services and am using Spring-Boot to create an embedded tomcat container.
其中一个要求是实现2路SSL 。我一直在查看HttpSecurity对象,并且可以使用它来仅通过SSL通道运行web服务: -
One of the requirements is that this implements 2 way SSL. I've been looking at the HttpSecurity object and can get it to only run the webservices over an SSL channel using this:-
@Override
protected void configure(HttpSecurity http) throws Exception {
System.out.println("CONFIGURED");
http
// ...
.requiresChannel()
.anyRequest().requiresSecure();
}
我似乎无法找到的只是制作网络服务的方式提供有效客户证书的应用程序可访问。
What I can't seem to find is a way of making the webservice only accessible to applications providing a valid client cert.
我只有SSL的基本知识,所以即使是正确方向的一般指针也会受到赞赏。
I have only a basic knowledge of SSL so even a general pointer in the right direction would be appreciated.
正在部署的服务器将混合使用多个应用程序 - 这是唯一需要使用双向SSL锁定的应用程序。我真正想要的是一种锁定单个应用程序只接受客户端证书的方法。
The server this is being deployed onto will have a mix of applications - this is the only one that needs to be locked down with 2-way SSL. What I'm really looking for is a way of locking down a single application to only accept client certificates.
推荐答案
您可以配置 clientAuth = want
,参见:
然后使用:
和
这篇关于使用spring boot实现2路SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!