java - 对 CXF 服务器的 C/C++ SSL 请求

标签 java c++ spring tomcat ssl

首先,我使用cxf-spring-json-tomcat开发了一个web服务器。虽然,我创建了 JKS keystore 文件并配置了我的 tomcat 服务器以使用 SSL 连接。而且,我可以使用 chrome、firefox 向我的服务器请求。

我的服务器 Bean:

@Service
@Path("/tservice")
public class TestService {


    @GET
    @Path("/{message}")
    @Produces("application/json")
    public Response find(@PathParam("message") String message)
    {
        Result result = new Result();
        result.setMessage(message);
        result.setResultId(Math.random());
        return Response.status(Status.OK).entity(result).type(MediaType.APPLICATION_JSON).build();
    }

}

Tomcat 服务器.xml (SSL)

<Connector port="8443" protocol="HTTP/1.1"
               maxThreads="200" SSLEnabled="true" scheme="https" secure="true"
               keystoreFile="/home/**/.keystore" keystorePass="123456"
               clientAuth="false" sslProtocol="TLS" />

我的问题是(对于服务器端)我必须在我的 java 类中为 ssl 进行另一个配置或添加代码部分?

客户端的另一个问题是;

我需要使用 SSL 连接开发 C/C++ 客户端应用程序。我应该考虑什么?他们有什么技巧吗?有什么建议、示例或教程吗?

非常感谢。

最佳答案

您在tomcat中配置SSL,因此tomcat会处理SSL请求。无需更改服务器端的任何代码。

关于java - 对 CXF 服务器的 C/C++ SSL 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30024881/

相关文章:

java - 在构建针对多个实体运行的通用 Lucene 查询时如何排除或忽略字段

java - 异常:com. fastxml.jackson.core.JsonParseException:HttpMessageNotReadableException

java - Spring Batch从文件获取数据并传递给过程

c++ - 在模板中使用二叉树作为优先级队列

java - 识别由于网络问题导致的 SQLException

java - JScrollPane 中的 JTextArea 换行但缺少字母

java - Spring Boot-postForEntity() : what is content type of the response?

java - 自 java 7 升级 45 以来,jnlp 无法再传递大型属性

c++ - 在编译时生成模板参数

c++ - 使用 openmp 优化循环