jgraph / docker-drawio

Dockerized draw.io based on whichever is the most secure image at the time.
GNU General Public License v3.0
1.49k stars 361 forks source link

Draw.io https port not working. #61

Closed CharlPels closed 2 years ago

CharlPels commented 2 years ago

When you deploy the drawio container (latest versions) port 8443 is not working anymore. It should respond with self signed Certificate.

the http port 8080 works fine however not with things like onedrive.

in the log you see things like

12-Feb-2022 17:52:27.542 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["https-openssl-nio-8443"] 12-Feb-2022 17:52:27.552 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[org.apache.coyote.http11.Http11NioProtocol-8443]] org.apache.catalina.LifecycleException: Protocol handler initialization failed at org.apache.catalina.connector.Connector.initInternal(Connector.java:1055) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:556) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1042) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) at org.apache.catalina.startup.Catalina.load(Catalina.java:747) at org.apache.catalina.startup.Catalina.load(Catalina.java:769) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:305) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475) Caused by: java.lang.IllegalArgumentException: No SSLHostConfig element was found with the hostName [default] to match the defaultSSLHostConfigName for the connector [https-openssl-nio-8443] at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:76) at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:202) at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1179) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1192) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:580) at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:82) at org.apache.catalina.connector.Connector.initInternal(Connector.java:1052) ... 13 more 12-Feb-2022 17:52:27.559 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [3169] milliseconds 12-Feb-2022 17:52:28.005 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]

versions like 16.4.3 run with no issue

waverdog commented 2 years ago

New tomcat requires next SSL configuration in conf/server.xml

defaultSSLHostConfigName="example.com">
    <SSLHostConfig hostName="example.com"
                   protocols="TLSv1.2"> 
    <Certificate certificateKeystoreFile="/usr/local/tomcat/.keystore"
        certificateKeystorePassword="V3ry1nS3cur3P4ssw0rd"/>
    </SSLHostConfig>
CharlPels commented 2 years ago

Thanks,

Connector now looks like this

<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" KeystoreFile="/usr/local/tomcat/.keystore" KeystorePass="V3ry1nS3cur3P4ssw0rd" defaultSSLHostConfigName="example.com"> <SSLHostConfig hostName="example.com" protocols="TLSv1.2"> <Certificate certificateKeystoreFile="/usr/local/tomcat/.keystore" certificateKeystorePassword="V3ry1nS3cur3P4ssw0rd"/> </SSLHostConfig> </Connector> https is working that way however onedrive support is not, will give object not found. Looks like there is some work to do to support cloud storage :-( I use an nginx as proxy with propper certs ofcource, version jgraph/drawio:16.4.3 is working fine

m-mohamedin commented 2 years ago

Problem fixed. Thanks for the report and the suggested fix

m-mohamedin commented 2 years ago

Regarding OneDrive, please check the documentation here https://github.com/jgraph/docker-drawio/tree/dev/self-contained