Hello !
I’m struggling with the setup of the HTTPS protocol for the repository manager.
I’ve correctly installed and configured nginx to use the 443 port and to send requests to the website :
server {
listen 443 ssl;
server_name hereismydomain;
ssl_certificate /etc/letsencrypt/live/hereismydomain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/hereismydomain/privkey.pem;
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
The website works now with https, but the repositories URLs still are with “http”. This prevents me from getting any code from the nexus with Maven (since http protocol is not supported anymore by Maven from the 3.8.1 version, and I cannot downgrade Maven’s version).
I followed the tutorial to setup HTTPS : I first set application-ssl-port=443
in the nexus.properties file. I then uncommented the line nexus-args and added the argument ${jetty.etc}/jetty-https.xml
. But when I restart with these parameters, I get this error :
java.lang.NoSuchMethodException: class org.eclipse.jetty.server.HttpConfiguration.setSecurePort(class java.lang.Object). Found setters for int
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:742)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:509)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.refObj(XmlConfiguration.java:1063)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:530)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:468)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:380)
Jan 22 15:08:21 myname nexus[10470]: at org.sonatype.nexus.bootstrap.jetty.JettyServer.doStart(JettyServer.java:168)
Jan 22 15:08:21 myname nexus[10470]: at org.sonatype.nexus.bootstrap.jetty.JettyServer.lambda$0(JettyServer.java:117)
Jan 22 15:08:21 myname nexus[10470]: at java.security.AccessController.doPrivileged(Native Method)
Jan 22 15:08:21 myname nexus[10470]: at org.sonatype.nexus.bootstrap.jetty.JettyServer.start(JettyServer.java:115)
Jan 22 15:08:21 myname nexus[10470]: at org.sonatype.nexus.bootstrap.Launcher.start(Launcher.java:131)
Jan 22 15:08:21 myname nexus[10470]: at org.sonatype.nexus.bootstrap.Launcher.startAsync(Launcher.java:127)
Jan 22 15:08:21 myname nexus[10470]: at org.sonatype.nexus.bootstrap.osgi.LauncherActivator.start(LauncherActivator.java:67)
Jan 22 15:08:21 myname nexus[10470]: at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:698)
Jan 22 15:08:21 myname nexus[10470]: at org.apache.felix.framework.Felix.activateBundle(Felix.java:2402)
Jan 22 15:08:21 myname nexus[10470]: at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
Jan 22 15:08:21 myname nexus[10470]: at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
Jan 22 15:08:21 myname nexus[10470]: at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
Jan 22 15:08:21 myname nexus[10470]: at java.lang.Thread.run(Thread.java:750)
Jan 22 15:08:21 myname nexus[10470]: Suppressed: java.lang.NoSuchMethodException: org.eclipse.jetty.server.HttpConfiguration.setSecurePort(java.lang.Object)
Jan 22 15:08:21 myname nexus[10470]: at java.lang.Class.getMethod(Class.java:1786)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:601)
Jan 22 15:08:21 myname nexus[10470]: ... 18 common frames omitted
Jan 22 15:08:21 myname nexus[10470]: Suppressed: java.lang.NoSuchFieldException: TYPE
Jan 22 15:08:21 myname nexus[10470]: at java.lang.Class.getField(Class.java:1703)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:614)
Jan 22 15:08:21 myname nexus[10470]: ... 18 common frames omitted
Jan 22 15:08:21 myname nexus[10470]: Suppressed: java.lang.NoSuchFieldException: securePort
Jan 22 15:08:21 myname nexus[10470]: at java.lang.Class.getField(Class.java:1703)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:629)
Jan 22 15:08:21 myname nexus[10470]: ... 18 common frames omitted
Jan 22 15:08:21 myname nexus[10470]: Suppressed: java.lang.IllegalArgumentException: null
Jan 22 15:08:21 myname nexus[10470]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Jan 22 15:08:21 myname nexus[10470]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Jan 22 15:08:21 myname nexus[10470]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Jan 22 15:08:21 myname nexus[10470]: at java.lang.reflect.Method.invoke(Method.java:498)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.invokeMethod(XmlConfiguration.java:765)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:679)
Jan 22 15:08:21 myname nexus[10470]: ... 18 common frames omitted
Jan 22 15:08:21 myname nexus[10470]: Suppressed: java.lang.NoSuchMethodException: java.lang.Integer.<init>(java.lang.Object)
Jan 22 15:08:21 myname nexus[10470]: at java.lang.Class.getConstructor0(Class.java:3082)
Jan 22 15:08:21 myname nexus[10470]: at java.lang.Class.getConstructor(Class.java:1825)
Jan 22 15:08:21 myname nexus[10470]: at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:725)
Jan 22 15:08:21 myname nexus[10470]: ... 18 common frames omitted
My nexus.properties file is :
nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-https.xml,${jetty.etc}/jetty-requestlog.xml
application-ssl-port=443
My nexus-default.properties file :
## DO NOT EDIT - CUSTOMIZATIONS BELONG IN $data-dir/etc/nexus.properties
##
# Jetty section
application-port=8081
application-host=0.0.0.0
nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml
nexus-context-path=/
# Nexus section
nexus-edition=nexus-pro-edition
nexus-features=\
nexus-pro-feature
nexus.hazelcast.discovery.isEnabled=true
I’ve got the problem with two versions : the latest one (3.45) and the 3.41 version.
Does anybody know how to fix this ?
Regards,