-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fixes #11892 - mtls not working with http/3. #11900
Merged
sbordet
merged 4 commits into
jetty-12.0.x
from
fix/jetty-12.0.x/11892/mtls-http3-request-attribute
Jun 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...sports/src/test/java/org/eclipse/jetty/ee10/test/client/transport/NeedClientAuthTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// ======================================================================== | ||
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License v. 2.0 which is available at | ||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// ======================================================================== | ||
// | ||
|
||
package org.eclipse.jetty.ee10.test.client.transport; | ||
|
||
import jakarta.servlet.http.HttpServlet; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import org.eclipse.jetty.client.ContentResponse; | ||
import org.eclipse.jetty.ee10.servlet.ServletContextRequest; | ||
import org.eclipse.jetty.http.HttpStatus; | ||
import org.eclipse.jetty.util.ssl.SslContextFactory; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
public class NeedClientAuthTest extends AbstractTest | ||
{ | ||
@ParameterizedTest | ||
@MethodSource("transportsSecure") | ||
public void testNeedClientAuth(Transport transport) throws Exception | ||
{ | ||
prepareServer(transport, new HttpServlet() | ||
{ | ||
@Override | ||
protected void service(HttpServletRequest request, HttpServletResponse response) | ||
{ | ||
// Verify that the request attribute is present. | ||
assertNotNull(request.getAttribute(ServletContextRequest.PEER_CERTIFICATES)); | ||
} | ||
}); | ||
sslContextFactoryServer.setNeedClientAuth(true); | ||
server.start(); | ||
|
||
startClient(transport, httpClient -> | ||
{ | ||
// Configure the SslContextFactory to send a certificate to the server. | ||
SslContextFactory.Client clientSSL = httpClient.getSslContextFactory(); | ||
clientSSL.setKeyStorePath("src/test/resources/keystore.p12"); | ||
clientSSL.setKeyStorePassword("storepwd"); | ||
clientSSL.setCertAlias("mykey"); | ||
}); | ||
|
||
ContentResponse response = client.newRequest(newURI(transport)).send(); | ||
|
||
assertEquals(HttpStatus.OK_200, response.getStatus()); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe javadoc that only the top/last/single certificate will be returned.