1

As of last Friday, an error is showing up when I do a 'grails war' with one of my Grails 2.2.5 applications:

:::: ERRORS
    SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/grails/plugins/mail/1.0.8-SNAPSHOT/maven-metadata.xml

    SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/grails/plugins/mail/1.0.8-SNAPSHOT/mail-1.0.8-SNAPSHOT.pom

    SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/grails/plugins/mail/1.0.8-SNAPSHOT/mail-1.0.8-SNAPSHOT.jar

The build seems to complete OK, but I'm concerned nonetheless. The error has just started happening, there have been no changes within my code, so I'm presuming it's to do with some change at a repo. In my BuildConfig.groovy, I have the plugins repo defined thus:

mavenRepo "http://repo.grails.org/grails/plugins"

I wondered whether I might merely have to change this to https, but if I do so I get errors like the following: Server access Error: Received fatal alert: protocol_version url=https://repo.grails.org/grails/plugins/org/grails/plugins/mail/1.0.8-SNAPSHOT/maven-metadata.xml and the build fails because of unresolved dependencies.

John Moore
  • 6,739
  • 14
  • 51
  • 67

2 Answers2

1

You are either using an old Java version or a misconfigured one.

See javax.net.ssl.SSLException: Received fatal alert: protocol_version for details how to deal with the protocol_version error.

And yes, you have to use https for the URL - repo.grails.org has moved over to https quite some time ago (citation needed)

cfrick
  • 35,203
  • 6
  • 56
  • 68
  • 1
    I was able to resolve the protocol_version by adding `-Dhttps.protocols=TLSv1.2` to the command which builds the war, but the original error messages still show up. Is it possible that this is something which needs to be changed within the plugin code itself? – John Moore Jan 20 '20 at 16:17
  • You added it to the buildconf (or whats it called) and that fixed building the war? Or do you use JAVA_OTPS or GRAILS_OPTS (both from my memory, they might be called differently) – cfrick Jan 20 '20 at 16:23
  • Oh and when you say "for this plugin" - have you bisected this problem? Is it really _only_ for the mails plugin? Or related to just snapshots? – cfrick Jan 20 '20 at 16:25
  • I use a batch file to do the 'grails war' - basically what IntelliJ generates but with the memory tweaked a little. I put the `-Dhttps.protocols=TLSv1.2` there, which ensures that Java (in my case jdk1.7.0_79) is using TLS 1.2. It prevented the fatal 'protocol_version' error and thus allowed the build to complete, although the original messages still displayed. – John Moore Jan 20 '20 at 16:34
  • Yes, it's only the Mail plugin. There are other plugins installed, but only the Mail one causes the error message on build. – John Moore Jan 20 '20 at 16:34
  • If you get this error inside IntelliJ, add the option there too. But for your own sanity: get rid of this nearly five year old version of java and use the newest. There are nowadays decent builds of the openjdk with all security stuff in it even for windows (at least zulu, don't know about adopt) – cfrick Jan 20 '20 at 16:39
  • 1
    To move to Java 8 I would have to upgrade from Grails 2.2.5 to a later version, which is a reasonably large issue. – John Moore Jan 20 '20 at 16:43
  • I am talking about 7 - only Oracle wont give you the updates for free any longer. – cfrick Jan 20 '20 at 16:44
  • You mean a later version of OpenJDK 7? – John Moore Jan 20 '20 at 16:51
  • Yes. E.g. Azul provides community builds for windows from 6 and up. I dont know about other openjdk "distributionns" – cfrick Jan 20 '20 at 16:58
  • _I was able to resolve the protocol_version by adding -Dhttps.protocols=TLSv1.2 to the command which builds the war, but the original error messages still show up_ worked for me on trying to run an downloaded app at Grails 2.5.6 – Alan Telles May 12 '21 at 18:43
0

in this URL you can find this lib, I use it: https://repo.grails.org/ui/native/plugins/org/grails/plugins/mail/1.0.8-SNAPSHOT/

I use with my local maven mavenLocal().

loppra
  • 61
  • 1
  • 2