JETTY with SSL
来源:互联网 发布:何祚庥 知乎 编辑:程序博客网 时间:2024/06/07 09:44
创建keystore相关资料
基于jetty9 编程构建嵌入式https 服务器
java中Keytool的使用总结
实践代码
封装了个函数, 方便构造出一个Connector
ServerConnector buildSslConnector(Server server, int securePort, String keyStorePath, String keyStorePassword, String keyManagerPassword) { HttpConfiguration https_config = new HttpConfiguration(); https_config.setSecureScheme("https"); https_config.setSecurePort(securePort); https_config.addCustomizer(new SecureRequestCustomizer()); SslContextFactory sslContextFactory = new SslContextFactory(); sslContextFactory.setKeyStorePath(keyStorePath); sslContextFactory.setKeyStorePassword(keyStorePassword); sslContextFactory.setKeyManagerPassword(keyManagerPassword); ServerConnector httpsConnector = new ServerConnector(server, new SslConnectionFactory(sslContextFactory, "http/1.1"), new HttpConnectionFactory(https_config)); httpsConnector.setPort(securePort); return httpsConnector; }
服务器启动代码
Server httpServer = new Server(); ServerConnector sslConnector = buildSslConnector(httpServer, 端口, keystore文件, keystore密码, 证书密码); httpServer.addConnector(sslConnector); //加入web app try { httpServer.start(); httpServer.join(); } catch (Exception e) { e.printStackTrace(); }
需要注意的是, 证书的被颁发者要和域名一致, 且手动添加到可信证书中, 否则浏览器不认
0 0
- JETTY with SSL
- Jetty下SSL配置
- jetty tomcat 配置ssl
- Jetty ssl配置
- Jetty下SSL配置
- nginx tomcat jetty双向ssl
- jetty-ssl.xml文件配置
- work with Jetty
- 服务器 配置SSL for nginx && springboot(jetty)
- jetty maven https(SSL)配置
- Apache with SSL
- Using RMI with SSL
- ASIHTTPRequest with SSL
- Mininet with SSL connection
- install apache with ssl
- mosquitto install with ssl
- jetty嵌入式开发中使用ssl连接,ssl证书生成
- Starting Jetty in Debug Mode With Gradle
- iOS 通知监听
- 整合ssh的时候遇到的错误
- javascript工具库记录,逐渐添加。(以便日后使用方便)
- 计算机网络基础篇
- Oracle中创建dblink的两种方式
- JETTY with SSL
- JAVA中类修饰具体有哪些?其中如果class前面什么都不加,它默认的是什么?
- spring 事务管理的配置方式
- 【创建型模式】原型模式(Prototype)之23种java设计模式
- 在SpringMVC中获取request对象的几种方式
- Android学习(36) -- 自定义控件(1)实现组合按钮的菜单和隐藏
- 最大后验估计(MAP)
- 三、svn--权限设置
- Android studio入门详细教程,首次启动配置,不翻墙搞定