jiteshkhatri11 opened a new pull request, #1907:
URL: https://github.com/apache/maven-resolver/pull/1907

   ### Problem
   
   `AuthenticationBuilder` currently has no way to set an `SSLContext` for 
   client certificate / mTLS based authentication.
   
   Although HTTP transporters already consume 
`AuthenticationContext.SSL_CONTEXT`, 
   for example in `JdkTransporter`:
   
   ```java
   sslContext = repoAuthContext.get(AuthenticationContext.SSL_CONTEXT, 
SSLContext.class);
   ```
   
   there was no way for callers to actually set it via `AuthenticationBuilder`. 
   The only workaround was via system properties as described in 
   https://maven.apache.org/guides/mini/guide-repository-ssl.html
   
   Closes #1851
   
   ---
   
   ### Solution
   
   Adds a new `addSslContext(SSLContext)` method to `AuthenticationBuilder`, 
   consistent with the existing `addHostnameVerifier(HostnameVerifier)` 
pattern, 
   so that mTLS credentials can be set and consumed through 
   `AuthenticationContext.SSL_CONTEXT`.
   
   ### Usage
   
   ```java
   Authentication auth = new AuthenticationBuilder()
       .addSslContext(mySSLContext)
       .build();
   ```
   
   ---
   
   ### Testing
   
   - `mvn verify` passes locally — 422 tests, 0 failures, 0 errors.
   - Unit test for `addSslContext()` can be added if maintainer requests it.
   
   ---
   
   ### Checklist
   
   - [x] Pull request addresses just one issue
   - [x] Description explains what, how, and why
   - [x] Commit has a meaningful subject line and body
   - [ ] Unit tests written
   - [x] `mvn verify` passed locally
   - [ ] Integration tests run
   - [x] I hereby declare this contribution to be licenced under the 
         Apache License Version 2.0, January 2004


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to