如何在 Java 7 中启用 TLSv1.2? [英] How to enable TLSv1.2 in java 7?

查看:77
本文介绍了如何在 Java 7 中启用 TLSv1.2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用命令 -mvn -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 install/mvn -Dhttps.protocols=TLSv1.2 install 在具有 java 1.7 的机器中启用 TSLv1.2.但是它抛出了一些错误,说我的 pom.xml 有一些未解决的依赖项,这些依赖项错误是因为我的项目由于 TSLv1.2 问题而无法从 Maven 存储库下载.对我来说似乎是一个僵局,任何人都可以帮助我解决它吗?

I'm trying to enable TSLv1.2 in my machine which has java 1.7 using the commands -mvn -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 install / mvn -Dhttps.protocols=TLSv1.2 install. But its throwing some errors saying my pom.xml has some unresolved dependencies, those dependencies errors are there because my project couldn't download from maven repository due to TSLv1.2 issue. Seems like a deadlock to me, Can anyone help me on how to resolve it?

推荐答案

您需要配置 MAVEN_OPTS env 变量或 settings.xml 以将正确的 vm args 传递给 JVM(maven JVM)

You need to configure MAVEN_OPTS env variable or settings.xml to pass proper vm args to JVM (maven JVM)

为了快速测试,试试这个

For quick test, try this

MAVEN_OPTS 设置为 -Dhttps.protocols=TLSv1.2,TLSv1.1

export MAVEN_OPTS=-Dhttps.protocols=TLSv1.2,TLSv1.1

(导出适用于基于 Unix 的系统,对于 Windows,请参见 这里)

(export is for unix based system, for windows see here)

并重新运行您的 maven 命令

and re-run your maven command

阅读更多关于 maven 的配置

这篇关于如何在 Java 7 中启用 TLSv1.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆