OpenAS2 / OpenAs2App

OpenAS2 is a java-based implementation of the EDIINT AS2 standard. It is intended to be used as a server. It is extremely configurable and supports a wide variety of signing and encryption algorithms.
https://sourceforge.net/projects/openas2/
GNU General Public License v3.0
185 stars 137 forks source link

Cannot connect to AS2 from WebUI, error: EMPTY_RESPONSE #320

Closed LordMax2 closed 6 months ago

LordMax2 commented 1 year ago

Hi!

I have the docker container running on a windows machine, it seems to boot up right both the server and the WebUI, but when I try to login to the docker container I get the error: xhr.js:187 GET http://127.0.0.1:8443/api/ net::ERR_EMPTY_RESPONSE

The commands I run are: docker run -it --rm -p 4080:10080 -p 4081:10081 -p 8443:8443 openas2:latest (net host and -p doesnt seem to be compatible together, can they reach each other anyways?) docker run --rm -p 8080:80 openas2_webui:latest

Heres the RUN output from the Server:

docker run -it --rm -p 4080:10080 -p 4081:10081 -p 8443:8443 openas2:latest
The config folder is empty, it will be populated by the template...
Done!

Running /usr/local/openjdk-11/bin/java -Xms32m -Xmx384m -Dorg.apache.commons.logging.Log=org.openas2.logging.Log -Dopenas2.config.file=/opt/openas2/bin/../config/config.xml -cp .:/opt/openas2/bin/../lib/activation-1.1.jar:/opt/openas2/bin/../lib/angus-activation-1.0.0.jar:/opt/openas2/bin/../lib/aopalliance-repackaged-3.0.3.jar:/opt/openas2/bin/../lib/bcmail-jdk18on-1.72.jar:/opt/openas2/bin/../lib/bcpg-jdk18on-1.72.2.jar:/opt/openas2/bin/../lib/bcpkix-jdk18on-1.72.jar:/opt/openas2/bin/../lib/bcprov-jdk18on-1.72.jar:/opt/openas2/bin/../lib/bcutil-jdk18on-1.72.jar:/opt/openas2/bin/../lib/commons-cli-1.5.0.jar:/opt/openas2/bin/../lib/commons-codec-1.11.jar:/opt/openas2/bin/../lib/commons-io-2.11.0.jar:/opt/openas2/bin/../lib/commons-lang3-3.12.0.jar:/opt/openas2/bin/../lib/commons-logging-1.2.jar:/opt/openas2/bin/../lib/dom4j-2.1.3.jar:/opt/openas2/bin/../lib/grizzly-framework-4.0.0.jar:/opt/openas2/bin/../lib/grizzly-http-4.0.0.jar:/opt/openas2/bin/../lib/grizzly-http-server-4.0.0.jar:/opt/openas2/bin/../lib/h2-2.1.214.jar:/opt/openas2/bin/../lib/hk2-api-3.0.3.jar:/opt/openas2/bin/../lib/hk2-locator-3.0.3.jar:/opt/openas2/bin/../lib/hk2-utils-3.0.3.jar:/opt/openas2/bin/../lib/httpclient-4.5.14.jar:/opt/openas2/bin/../lib/httpcore-4.4.16.jar:/opt/openas2/bin/../lib/jackson-annotations-2.14.1.jar:/opt/openas2/bin/../lib/jackson-core-2.14.1.jar:/opt/openas2/bin/../lib/jackson-databind-2.14.1.jar:/opt/openas2/bin/../lib/jackson-module-jakarta-xmlbind-annotations-2.13.3.jar:/opt/openas2/bin/../lib/jakarta.activation-2.0.1.jar:/opt/openas2/bin/../lib/jakarta.activation-api-2.1.0.jar:/opt/openas2/bin/../lib/jakarta.annotation-api-2.1.1.jar:/opt/openas2/bin/../lib/jakarta.inject-api-2.0.1.jar:/opt/openas2/bin/../lib/jakarta.validation-api-3.0.2.jar:/opt/openas2/bin/../lib/jakarta.ws.rs-api-3.1.0.jar:/opt/openas2/bin/../lib/jakarta.xml.bind-api-4.0.0.jar:/opt/openas2/bin/../lib/javassist-3.28.0-GA.jar:/opt/openas2/bin/../lib/javax.activation-api-1.2.0.jar:/opt/openas2/bin/../lib/javax.annotation-api-1.3.2.jar:/opt/openas2/bin/../lib/javax.mail-1.6.2.jar:/opt/openas2/bin/../lib/javax.ws.rs-api-2.1.1.jar:/opt/openas2/bin/../lib/jaxb-api-2.4.0-b180830.0359.jar:/opt/openas2/bin/../lib/jaxb-core-4.0.1.jar:/opt/openas2/bin/../lib/jaxb-impl-4.0.1.jar:/opt/openas2/bin/../lib/jersey-client-3.1.0.jar:/opt/openas2/bin/../lib/jersey-common-3.1.0.jar:/opt/openas2/bin/../lib/jersey-container-grizzly2-http-3.1.0.jar:/opt/openas2/bin/../lib/jersey-entity-filtering-3.1.0.jar:/opt/openas2/bin/../lib/jersey-hk2-3.1.0.jar:/opt/openas2/bin/../lib/jersey-media-json-jackson-3.1.0.jar:/opt/openas2/bin/../lib/jersey-server-3.1.0.jar:/opt/openas2/bin/../lib/openas2-server-3.5.0.jar:/opt/openas2/bin/../lib/osgi-resource-locator-1.0.3.jar:/opt/openas2/bin/../lib/sentry-6.10.0.jar:/opt/openas2/bin org.openas2.app.OpenAS2Server

2023-05-29 14:19:25.916 FINE OpenAS2Server: Retrieving config file...
2023-05-29 14:19:26.189 FINE OpenAS2Server: Using MANIFEST file:/opt/openas2/lib/openas2-server-3.5.0.jar!/META-INF/MANIFEST.MF
2023-05-29 14:19:26.254 FINE XMLSession: Loading configuration...
2023-05-29 14:19:26.254 FINE XMLSession: Loading properties...
2023-05-29 14:19:26.641 FINE XMLSession: Loading log manager(s)...
2023-05-29 14:19:26.642 FINE XMLSession: Logger is disabled ... ignoring: org.openas2.logging.EmailLogger
2023-05-29 14:19:26.644 FINE XMLSession: Logger is disabled ... ignoring: org.openas2.logging.SocketLogger
2023-05-29 14:19:26.660 FINE XMLSession: Loading command processor(s)...
2023-05-29 14:19:26.663 FINE XMLSession: Command processor is disabled ... ignoring: org.openas2.cmd.processor.SocketCommandProcessor
2023-05-29 14:19:26.676 FINE RestCommandProcessor: RestCommandProcessor initialized...
2023-05-29 14:19:26.721 FINE RestCommandProcessor: Creating and starting a new instance of grizzly http server
2023-05-29 14:19:26.723 FINE RestCommandProcessor: Exposing the Jersey application at http://localhost:8443
May 29, 2023 2:19:27 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [localhost:8443]
May 29, 2023 2:19:27 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
2023-05-29 14:19:27.407 FINE XMLSession: Loading processor nodes...
2023-05-29 14:19:27.459 FINE XMLSession: Module is disabled ... ignoring: <module classname="org.openas2.processor.receiver.AS2ReceiverModule" enabled="$properties.module.AS2ReceiverModule.https.enabled$" errordir="$properties.storageBaseDir$/inbox/error" errorformat="sender.as2_id, receiver.as2_id, headers.message-id" port="$properties.module.AS2ReceiverModule.https.port$" protocol="https" ssl_keystore="$properties.ssl_keystore$" ssl_keystore_password="$properties.ssl_keystore_password$" ssl_protocol="TLS"/>
2023-05-29 14:19:27.461 FINE XMLSession: Module is disabled ... ignoring: <module classname="org.openas2.processor.receiver.AS2MDNReceiverModule" enabled="$properties.module.AS2MDNReceiverModule.https.enabled$" port="$properties.module.AS2MDNReceiverModule.https.port$" protocol="https" ssl_keystore="$properties.ssl_keystore$" ssl_keystore_password="$properties.ssl_keystore_password$" ssl_protocol="TLS"/>
2023-05-29 14:19:27.464 FINE XMLSession: Module is disabled ... ignoring: <module classname="org.openas2.processor.receiver.HealthCheckModule" enabled="$properties.module.HealthCheckModule.enabled$" port="$properties.module.HealthCheckModule.port$"/>
2023-05-29 14:19:27.464 FINE XMLSession: Loading partnerships...
2023-05-29 14:19:27.495 FINE IOUtil: Created directory /opt/openas2/bin/../config/../data/outbox/PartnerA_OID
2023-05-29 14:19:27.497 FINE IOUtil: Created directory /opt/openas2/bin/../config/../data/outbox/error/2023-05-29/PartnerA_OID
2023-05-29 14:19:27.498 FINE IOUtil: Created directory /opt/openas2/bin/../config/../data/pendinginfoMDN3
2023-05-29 14:19:27.499 FINE IOUtil: Created directory /opt/openas2/bin/../config/../data/pendingMDN3
2023-05-29 14:19:27.501 FINE IOUtil: Created directory /opt/openas2/bin/../config/../data/outbox/PartnerB_OID
2023-05-29 14:19:27.502 FINE IOUtil: Created directory /opt/openas2/bin/../config/../data/outbox/error/2023-05-29/PartnerB_OID
2023-05-29 14:19:27.503 FINE XMLSession: Loading messages...
2023-05-29 14:19:27.511 FINE OpenAS2Server: Shutdown hook registered.
2023-05-29 14:19:27.512 FINE OpenAS2Server: Starting OpenAS2 Server v3.5.0...
2023-05-29 14:19:27.685 FINE DefaultProcessor: DbTrackingModule started.
2023-05-29 14:19:27.700 FINE DefaultProcessor: AS2ReceiverModule started.
2023-05-29 14:19:27.701 FINE DefaultProcessor: AS2MDNReceiverModule started.
2023-05-29 14:19:27.704 FINE DefaultProcessor: DirectoryResenderModule started.
2023-05-29 14:19:27.705 FINE IOUtil: Created directory /opt/openas2/bin/../config/../data/resend
2023-05-29 14:19:27.708 FINE DefaultProcessor: 4 active module(s) started.
2023-05-29 14:19:27.711 FINE OpenAS2Server: OpenAS2 Server v3.5.0 started.

And here is the code output for the WebUI:

docker run --rm -p 8080:80 openas2_webui:latest
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2023/05/29 14:20:11 [notice] 1#1: using the "epoll" event method
2023/05/29 14:20:11 [notice] 1#1: nginx/1.25.0
2023/05/29 14:20:11 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
2023/05/29 14:20:11 [notice] 1#1: OS: Linux 5.15.90.1-microsoft-standard-WSL2
2023/05/29 14:20:11 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2023/05/29 14:20:11 [notice] 1#1: start worker processes
2023/05/29 14:20:11 [notice] 1#1: start worker process 29
2023/05/29 14:20:11 [notice] 1#1: start worker process 30
2023/05/29 14:20:11 [notice] 1#1: start worker process 31
2023/05/29 14:20:11 [notice] 1#1: start worker process 32
2023/05/29 14:20:11 [notice] 1#1: start worker process 33
2023/05/29 14:20:11 [notice] 1#1: start worker process 34
2023/05/29 14:20:11 [notice] 1#1: start worker process 35
2023/05/29 14:20:11 [notice] 1#1: start worker process 36

Thanks in advance! Best regards Max

LordMax2 commented 1 year ago

It seems to be that theres a lot of null in the frontend, is there something missing in the docker build? Or browser?

image

Maef commented 1 year ago

Hi Max,

I removed the ssl_* parameters and changed baseuri to 0.0.0.0 (in stead of localhost) in the file Server/src/config/config.xml

<commandProcessor classname="org.openas2.cmd.processor.RestCommandProcessor" 
                        enabled="$properties.restapi.command.processor.enabled$"
                        baseuri="http://0.0.0.0:8443"
                        userid="userID" 
                        password="pWd" />

Rebuild the whole and check if it works for you.

ThorTL67 commented 1 year ago

I had the same issue and @Maef 's solution works for me. Thanks

igwtech commented 1 year ago

SSL doesn't work on localhost due to lack of signed SSL Certificates. Also most browsers limit connections from Non-SSL to SSL sites due to privacy concerns.

If you are planning to deploy the WebUI on the wild I would recommend using SSL + domain names. If you are planning to testing it on Localhost disable SSL

On Wed, May 31, 2023 at 8:47 AM Tobias Leyland @.***> wrote:

I had the same issue and @Maef https://github.com/Maef 's solution works for me. Thanks

— Reply to this email directly, view it on GitHub https://github.com/OpenAS2/OpenAs2App/issues/320#issuecomment-1570170010, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2QND6QSZGOUCUGPORMFU3XI44VTANCNFSM6AAAAAAYS3ZRYY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Javier Munoz

CEO

Greicodex Software

+58 2127629120 <+58+2127629120> @.*** www.greicodex.com Av Francisco Solano, Centro Solano Plaza, Oficina PHA, Caracas, Venezuela

ThorTL67 commented 1 year ago

SSL doesn't work on localhost due to lack of signed SSL Certificates. Also most browsers limit connections from Non-SSL to SSL sites due to privacy concerns. If you are planning to deploy the WebUI on the wild I would recommend using SSL + domain names. If you are planning to testing it on Localhost disable SSL On Wed, May 31, 2023 at 8:47 AM Tobias Leyland @.> wrote: I had the same issue and @Maef https://github.com/Maef 's solution works for me. Thanks — Reply to this email directly, view it on GitHub <#320 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2QND6QSZGOUCUGPORMFU3XI44VTANCNFSM6AAAAAAYS3ZRYY . You are receiving this because you are subscribed to this thread.Message ID: @.> -- Javier Munoz CEO Greicodex Software +58 2127629120 <+58+2127629120> @.*** www.greicodex.com Av Francisco Solano, Centro Solano Plaza, Oficina PHA, Caracas, Venezuela

I think that the README should be modified slightly to declare this info, I'm happy to open a PR for this.

uhurusurfa commented 1 year ago

Please go ahead with a PR - that would be appreciated