Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException may occur for HTTPs requests to WebContainer #27900

Closed
pmd1nh opened this issue Mar 12, 2024 · 1 comment · Fixed by #27902
Closed

NullPointerException may occur for HTTPs requests to WebContainer #27900

pmd1nh opened this issue Mar 12, 2024 · 1 comment · Fixed by #27902
Assignees
Labels
in:Web Components release bug This bug is present in a released version of Open Liberty release:24004 team:Sirius

Comments

@pmd1nh
Copy link
Member

pmd1nh commented Mar 12, 2024

Describe the bug
If secured request (i.e https:// ) is accepted into the WebContainer but has an exception before the WebContainer can determine a target application to handle this request, the java.lang.NullPointerException can occur.

Same scenario does not have NPE using the un-secure (i.e http) request.

Steps to Reproduce
Send HTTPS with a bad encoded URI to an existing application (i.e context root). For example:

https://host:secure_port/%5%20C..

Expected behavior
No NullPointerException in either the response, message; no FFDC

Diagnostic information:

  • OpenLiberty Version: all version until this is fixed.
  • Affected feature(s) [servlet]
  • Java Version: [11]
  • server.xml configuration (WITHOUT sensitive information like passwords)
    need to enable SSL (<feature>transportSecurity-1.0</feature> , <keyStore/>, <ssl/> )
  • If it would be useful, upload the messages.log file found in $WLP_OUTPUT_DIR/messages.log

Additional context
None

@pmd1nh pmd1nh self-assigned this Mar 12, 2024
@pmd1nh pmd1nh added bug This bug is not present in a released version of Open Liberty release bug This bug is present in a released version of Open Liberty in:Web Components team:Sirius and removed bug This bug is not present in a released version of Open Liberty labels Mar 12, 2024
@pmd1nh pmd1nh changed the title NullPointerException may occur for HTTPs requests NullPointerException may occur for HTTPs requests to WebContainer Mar 12, 2024
@pmd1nh
Copy link
Member Author

pmd1nh commented Mar 12, 2024

FFDC

Exception = java.lang.NullPointerException
Source = com.ibm.ws.webcontainer.srt31.SRTConnectionContext.finishConnection
probeid = 64
Stack Dump = java.lang.NullPointerException: Cannot invoke "com.ibm.ws.webcontainer.webapp.WebApp.getConfiguration()" because "webApp" is null
	at com.ibm.ws.webcontainer.srt.SRTServletResponse.addSTSHeader(SRTServletResponse.java:1082)
	at com.ibm.ws.webcontainer.srt.SRTServletResponse.commit(SRTServletResponse.java:1025)
	at com.ibm.ws.webcontainer.srt.SRTServletResponse.finish(SRTServletResponse.java:283)
	at com.ibm.ws.webcontainer40.srt.SRTServletResponse40.finish(SRTServletResponse40.java:238)
	at com.ibm.ws.webcontainer31.osgi.srt.SRTConnectionContext31.finishConnection(SRTConnectionContext31.java:209)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1205)
	at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:293)
	at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1260)
	at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:476)
	at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:435)
	at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:569)
	at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:503)
	at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:363)
	at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:330)
	at com.ibm.ws.http.channel.h2internal.H2StreamProcessor$Http2Ready.run(H2StreamProcessor.java:1818)
	at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:280)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:857)

@pmd1nh pmd1nh mentioned this issue Mar 12, 2024
@pnicolucci pnicolucci added this to General Issues in Web Tier Team via automation Mar 12, 2024
Web Tier Team automation moved this from General Issues to Completed Tasks Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:Web Components release bug This bug is present in a released version of Open Liberty release:24004 team:Sirius
Projects
Archived in project
Web Tier Team
  
Completed Tasks
Development

Successfully merging a pull request may close this issue.

3 participants