Closed. This question does not meet
I am getting an error on server log:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.4.1)
2021-08-28 15:47:04.463 INFO 4513 --- [ main] c.a.MarketResearcher.ApplicationWar : Starting ApplicationWar v0.0.1-SNAPSHOT using Java 1.8.0_302 on ip-172-31-17-203.ap-south-1.compute.internal with PID 4513 (/home/ec2-user/MarketResearcher-0.0.1-SNAPSHOT.jar started by root in /home/ec2-user)
2021-08-28 15:47:04.467 INFO 4513 --- [ main] c.a.MarketResearcher.ApplicationWar : The following profiles are active: prod
2021-08-28 15:47:06.924 INFO 4513 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.ws.config.annotation.DelegatingWsConfiguration' of type [org.springframework.ws.config.annotation.DelegatingWsConfiguration$$EnhancerBySpringCGLIB$$b39d77f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-08-28 15:47:07.008 INFO 4513 --- [ main] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
2021-08-28 15:47:07.705 INFO 4513 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8443 (https)
2021-08-28 15:47:07.729 INFO 4513 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-08-28 15:47:07.730 INFO 4513 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.41]
2021-08-28 15:47:07.852 INFO 4513 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-08-28 15:47:07.852 INFO 4513 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3164 ms
2021-08-28 15:47:08.432 INFO 4513 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.25.Final
2021-08-28 15:47:08.894 INFO 4513 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-08-28 15:47:09.462 INFO 4513 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
2021-08-28 15:47:09.613 INFO 4513 --- [ main] o.h.e.boot.internal.EnversServiceImpl : Envers integration enabled? : true
2021-08-28 15:47:12.758 INFO 4513 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-08-28 15:47:13.322 INFO 4513 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-08-28 15:47:15.192 INFO 4513 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8443 (https) with context path ''
2021-08-28 15:47:15.223 INFO 4513 --- [ main] c.a.MarketResearcher.ApplicationWar : Started ApplicationWar in 11.771 seconds (JVM running for 12.677)
2021-08-28 15:52:41.387 INFO 4513 --- [nio-8443-exec-6] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-08-28 15:52:41.388 INFO 4513 --- [nio-8443-exec-6] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2021-08-28 15:52:41.390 INFO 4513 --- [nio-8443-exec-6] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms
2021-08-28 16:06:33.275 WARN 4513 --- [nio-8443-exec-4] org.hibernate.orm.deprecation : HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead
2021-08-28 16:06:33.391 WARN 4513 --- [nio-8443-exec-4] org.hibernate.orm.deprecation : HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead
2021-08-28 16:06:33.683 WARN 4513 --- [nio-8443-exec-4] org.hibernate.orm.deprecation : HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead
2021-08-28 16:06:33.738 WARN 4513 --- [nio-8443-exec-1] org.hibernate.orm.deprecation : HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead
2021-08-28 16:06:33.739 WARN 4513 --- [nio-8443-exec-3] org.hibernate.orm.deprecation : HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead
2021-08-28 16:06:33.747 WARN 4513 --- [io-8443-exec-10] org.hibernate.orm.deprecation : HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead
2021-08-28 16:06:33.845 WARN 4513 --- [nio-8443-exec-5] org.hibernate.orm.deprecation : HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead
2021-08-28 16:06:33.866 WARN 4513 --- [nio-8443-exec-2] org.hibernate.orm.deprecation : HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead
2021-08-28 16:06:34.021 WARN 4513 --- [nio-8443-exec-7] org.hibernate.orm.deprecation : HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead
2021-08-29 19:08:38.141 INFO 4513 --- [nio-8443-exec-5] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header
Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the HTTP protocol [RTSP/1.00x0d0x0a0x0d...]
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:559) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888) [tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597) [tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.41.jar!/:9.0.41]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_302]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_302]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.41.jar!/:9.0.41]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_302]
CodePudding user response:
There is no concept of separate SSL for ports. Whenever the user enters https://api.example.com, the browser translates it as api.example.com:443 and sends the request to the server.
Similarly, when you hit http://api.example.com, it's translated to api.example.com:80. The port for SSL (HTTPS) is 443. The default port for HTTP is 80.
In your case, if you use the 8443 port explicitly, SSL won’t work. Probably, you can host in 443 and route the API internally.
CodePudding user response:
create a virtual host for port 8843
<VirtualHost *:8843>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /xxx/xxx/xxx
<Directory /xxx/xxx/xxx>
Require All Granted
</Directory>
SSLEngine on
SSLCertificateFile "/xxx/xxx/xxx/xxx.pem"
SSLCertificateKeyFile "/xxx/xxx/xxx/xxx.pem"
SSLCertificateChainFile "/xxx/xxx/xxx/xxx.pem"
</VirtualHost>