美文网首页Spring Cloud
二、API安全机制-请求加密HTTPS

二、API安全机制-请求加密HTTPS

作者: 紫荆秋雪_文 | 来源:发表于2020-05-12 22:27 被阅读0次

源码下载

一、API安全机制-请求加密HTTPS API安全机制.png

  • 生成本地HTTPS证书
keytool -genkeypair -alias 名称 -keyalg RSA -keystore 存储路径/证书名称
  • 配置HTTPS证书
server:
  port: 8001
  ssl:
    key-store: classpath:raven.key
    key-store-password: 123456
    key-password: 123456
  • 发送http请求
http://127.0.0.1:8001/users/1

Bad Request
This combination of host and port requires TLS.

相关文章

网友评论

    本文标题:二、API安全机制-请求加密HTTPS

    本文链接:https://www.haomeiwen.com/subject/hrfwnhtx.html