0

I'm using the following command:

mvn -Djavax.net.debug=all install -Dhttps.protocols=TLSv1.2

This is what I'm getting:

Extension ec_point_formats, formats: [uncompressed]
Extension server_name, server_name: [host_name: repo.maven.apache.org]
***
[write] MD5 and SHA1 hashes:  len = 179
0000: 01 00 00 AF 03 01 5F 65   0B C6 21 3B 48 B2 CB 60  ......_e..!;H..`
0010: A0 C4 07 76 6E CD D9 6D   DB 0E 3A 52 EA BC 6C 1A  ...vn..m..:R..l.
0020: B0 81 69 27 20 A1 00 00   2A C0 09 C0 13 00 2F C0  ..i' ...*...../.
0030: 04 C0 0E 00 33 00 32 C0   07 C0 11 00 05 C0 02 C0  ....3.2.........
0040: 0C C0 08 C0 12 00 0A C0   03 C0 0D 00 16 00 13 00  ................
0050: 04 00 FF 01 00 00 5C 00   0A 00 34 00 32 00 17 00  ......\...4.2...
0060: 01 00 03 00 13 00 15 00   06 00 07 00 09 00 0A 00  ................
0070: 18 00 0B 00 0C 00 19 00   0D 00 0E 00 0F 00 10 00  ................
0080: 11 00 02 00 12 00 04 00   05 00 14 00 08 00 16 00  ................
0090: 0B 00 02 01 00 00 00 00   1A 00 18 00 00 15 72 65  ..............re
00A0: 70 6F 2E 6D 61 76 65 6E   2E 61 70 61 63 68 65 2E  po.maven.apache.
00B0: 6F 72 67                                           org
pool-1-thread-1, WRITE: TLSv1 Handshake, length = 179
[Raw write]: length = 184
0000: 16 03 01 00 B3 01 00 00   AF 03 01 5F 65 0B C6 21  ..........._e..!
0010: 3B 48 B2 CB 60 A0 C4 07   76 6E CD D9 6D DB 0E 3A  ;H..`...vn..m..:
0020: 52 EA BC 6C 1A B0 81 69   27 20 A1 00 00 2A C0 09  R..l...i' ...*..
0030: C0 13 00 2F C0 04 C0 0E   00 33 00 32 C0 07 C0 11  .../.....3.2....
0040: 00 05 C0 02 C0 0C C0 08   C0 12 00 0A C0 03 C0 0D  ................
0050: 00 16 00 13 00 04 00 FF   01 00 00 5C 00 0A 00 34  ...........\...4
0060: 00 32 00 17 00 01 00 03   00 13 00 15 00 06 00 07  .2..............
0070: 00 09 00 0A 00 18 00 0B   00 0C 00 19 00 0D 00 0E  ................
0080: 00 0F 00 10 00 11 00 02   00 12 00 04 00 05 00 14  ................
0090: 00 08 00 16 00 0B 00 02   01 00 00 00 00 1A 00 18  ................
00A0: 00 00 15 72 65 70 6F 2E   6D 61 76 65 6E 2E 61 70  ...repo.maven.ap
00B0: 61 63 68 65 2E 6F 72 67                            ache.org
[Raw read]: length = 5
0000: 15 03 01 00 02                                     .....
[Raw read]: length = 2
0000: 02 46                                              .F
pool-1-thread-1, READ: TLSv1 Alert, length = 2
pool-1-thread-1, RECV TLSv1 ALERT:  fatal, protocol_version
pool-1-thread-1, called closeSocket()
pool-1-thread-1, handling exception: javax.net.ssl.SSLException: Received fatal alert: protocol_version
pool-1-thread-1, IOException in getSession():  javax.net.ssl.SSLException: Received fatal alert: protocol_version
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.846s
[INFO] Finished at: Sat Sep 19 01:04:31 IST 2020
[INFO] Final Memory: 7M/121M
Finalizer, called close()
Finalizer, called closeInternal(true)
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-shade-plugin:1.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-shade-plugin:jar:1.4: Could not transfer artifact org.apache.maven.plugins:maven-shade-plugin:pom:1.4 from/to optional (https://repo.maven.apache.org/maven2/): peer not authenticated ->

The problem seems to be Received fatal alert: protocol_version but all solutions on the net suggest that this can be resolved by adding -Dhttps.protocols=TLSv1.2 to the command line. Why is it not working in my case.

Java version: 1.7.0_51 Maven version: 3.0.5

Daud
  • 7,429
  • 18
  • 68
  • 115
  • In short: you cannot give JVM arguments to maven via the command line but it must be done via environment variables. – Steffen Ullrich Sep 18 '20 at 20:15
  • @SteffenUllrich The answer to my question lies inside the comments of another answer referenced in the comments of the answer that this questions is marked a duplicate of. My question has a direct answer which you gave in the comment above. There's zero need to close this. – Daud Sep 18 '20 at 20:40
  • I'm not sure what you refer to. My comment only summarizes the only answer which was given on the other question and does not include information from any comments there. – Steffen Ullrich Sep 18 '20 at 20:46
  • @SteffenUllrich My mistake. Apologies – Daud Sep 19 '20 at 08:15

0 Answers0