maven下载不了仓库地址为https的依赖jar,配置参数忽略ssl安全检查

问题原因

私服使用的https地址,然后安全证书过期的或没有,使用maven命令时,可以添加以下参数,忽略安全检查

sh 复制代码
mvn -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

参数详解

  • Dmaven.wagon.http.ssl.insecure=true - 允许放松ssl安全检查;
  • Dmaven.wagon.http.ssl.allowall=true - 允许所有的X.509格式证书匹配,如果修改为false,则会执行和浏览器一致的检查;
  • Dmaven.wagon.http.ssl.ignore.validity.dates=true - 忽略证书过期的问题

idea配置默认参数

在idea中配置VM选项,然后就可以默认使用这些参数

maven配置setting,使其忽略安全检查

xml 复制代码
<proxies>
    <proxy>
          <id>my-proxy</id>
          <active>true</active>
          <protocol>http</protocol>
          <host>my-proxy-host</host>
          <port>my-proxy-port</port>
          <nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
          <!-- 添加以下三个参数 -->
          <sslHostConfig>
           	<!--指定是否信任所有证书-->
              <all>true</all>
               <!--指定使用的SSL协议版本-->
              <sslProtocol>all</sslProtocol>
               <!--指定是否启用SSL-->
              <sslEnabled>true</sslEnabled>
               <!--指定支持的SSL协议版本列表-->
              <sslProtocols>TLSv1.2</sslProtocols>
              <!--指定是否忽略证书验证-->
              <ignoreCertificates>true</ignoreCertificates>
              <!-- 指定是否信任自签名证书-->
              <trustSelfSigned>true</trustSelfSigned>
              <!-- 指定是否允许所有证书  -->
              <allowAllCerts>true</allowAllCerts>
          </sslHostConfig>
      </proxy>
 </proxies>
相关推荐
2501_916007471 天前
苹果商店iOS应用上架费用全面解析:开发者计划与审核费用计算
android·ios·小程序·https·uni-app·iphone·webview
Lsetea2 天前
证书没到期却报certificate has expired:OpenSSL定位中间证书与系统时间
运维·https·ssl证书·openssl·证书链
2501_916008892 天前
如何实现iOS App代码混淆:SwiftShield使用指南
android·ios·小程序·https·uni-app·iphone·webview
SDWAN_Cheap2 天前
HTTPS到底加密了什么?
https·数据加密
2601_953824612 天前
基于SSM的水果超市管理系统
java·tomcat·maven
2501_916008892 天前
怎么用 Godot 导出 iOS 应用并上架 App Store?签名字段该填什么?
android·ios·小程序·https·uni-app·iphone·webview
明月_清风2 天前
Maven 到底是什么?一篇文章搞懂 Java 项目构建与依赖管理
java·后端·maven
Lsetea2 天前
Nginx报No required SSL certificate was sent:mTLS客户端证书排查
运维·nginx·https·ssl·openssl
今年下半年2 天前
SpringBoot整合金蝶中间件
spring boot·中间件·maven
ZeroNews内网穿透3 天前
内网部署 Halo 建站,用 ZeroNews 免费内网穿透安全发布到公网(无公网 IP 也能 HTTPS 访问)
docker·https·内网穿透·nas·反向代理·halo·zeronews