How to enable TLSv1.2 in java 7?

风格不统一 提交于 2021-02-05 07:10:27

问题


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?


回答1:


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

set MAVEN_OPTS with -Dhttps.protocols=TLSv1.2,TLSv1.1

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

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

and re-run your maven command

read more on maven's configuration



来源:https://stackoverflow.com/questions/53136649/how-to-enable-tlsv1-2-in-java-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!