当前位置: 首页 > news >正文

使用centos服务器和Let‘s Encypted配置SpingBoot项目的https证书

一、Centos安装Certbot客户端

yum install certbot

二、生成证书

certbot certonly --standalone -d 你的域名

执行该命令后会生成如下文件

privkey.pem : the private key for your certificate.

fullchain.pem: the certificate file used in most server software.

chain.pem : used for OCSP stapling in Nginx >=1.3.7.

cert.pem : will break many server configurations, and should not be used without reading further documentation (see link below).

三、生成pfx文件

openssl pkcs12 -export -inkey privkey.pem -in cert.pem -certfile chain.pem -out 你的域名.pfx -legacy -name tomcat -passout pass:你的密码

四、配置SpringBoot的pom文件

server:#port: 80 #8091tomcat:uri-encoding: UTF-8http:encoding:charset: UTF-8servlet:context-path: encoding:charset: UTF-8session:timeout: 60d # 设置 Session 60 天后过期port: 443ssl:key-store: classpath:你的域名.pfx #pfx 具体的路径key-store-type: PKCS12key-store-password: 你的密码 #密码内容key-alias: tomcat

五、打包SpringBoot项目为jar文件

六、服务器执行jar文件

java -jar 你的项目名称.jar

http://www.dtcms.com/a/240085.html

相关文章:

  • 『uniapp』消息推送 unipush的对接 支持通知消息内容客户端自定义(保姆级图文)
  • 数字孪生+AR/VR的融合创新
  • RocketMQ 客户端负载均衡机制详解及最佳实践
  • Centos 7 服务器部署多网站
  • 关于uniapp展示PDF的解决方案
  • 相机Camera日志实例分析之一:相机Camx【前置慢动作分辨率切换720P、1080P录制】单帧流程日志详解
  • AirSim/Cosys-AirSim 游戏开发(四)外部固定位置监控相机
  • 相机Camera日志实例分析之二:相机Camx【专业模式开启直方图拍照】单帧流程日志详解
  • 三维GIS开发cesium智慧地铁教程(5)Cesium相机控制
  • ArcGIS Pro+ArcGIS给你的地图加上北回归线!
  • 相机从app启动流程
  • Qt 窗口
  • STA(Station)模式与AP(Access Point)模式
  • VSCode 使用CMake 构建 Qt 5 窗口程序
  • [C++错误经验]case语句跳过变量初始化
  • DAY 26 函数专题1:函数定义与参数
  • Word VBA快速制作填空题
  • 基于 PyTorch 和 OpenCV 的实时表情检测系统
  • OPENCV的cvtColor和putText的讲解
  • 零基础设计模式——行为型模式 - 命令模式
  • Unity | AmplifyShaderEditor插件基础(第六集:平面波动shader)
  • java中word快速转pdf
  • 2.2.2 ASPICE的需求分析
  • 大话软工笔记—需求分析概述
  • Vue 3 + WebSocket 实战:公司通知实时推送功能详解
  • 测试微信模版消息推送
  • Yii2项目自动向GitLab上报Bug
  • Linux-08 ubuntu 的 chrome浏览器不能使用 搜狗 输入法,但是火狐可以
  • 【MATLAB第119期】基于MATLAB的KRR多输入多输出全局敏感性分析模型运用(无目标函数,考虑代理模型)
  • 原型模式深度解析:Java设计模式实战指南与克隆机制优化实践