Charan
Charan

Reputation: 143

How to enable TLSv1.2 in java 7?

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?

Upvotes: 5

Views: 9071

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240966

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

Upvotes: 4

Related Questions