-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v3.x.x' into reboot/fix/authentication_header_for_route…
…d_requests
- Loading branch information
Showing
3 changed files
with
56 additions
and
5 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Run Client Certificate Authentication Sample | ||
|
||
This project is a Java-based client that performs authentication using a client certificate. | ||
It utilizes the Apache HTTP Client to send an HTTPS request with client certificate authentication. | ||
|
||
## Prerequisites | ||
|
||
1. Java 17 | ||
2. A valid trusted client certificate stored in a PKCS12 keystore (.p12 or .pfx file) | ||
|
||
## Running the application | ||
|
||
1. Build the client-cert-auth-sample | ||
2. Export the following environment variables: | ||
|
||
**macOS:** | ||
|
||
```shell | ||
export API_URL="<API_URL>" | ||
export CLIENT_CERT_PATH="<CLIENT_CERT_PATH>" | ||
export CLIENT_CERT_PASSWORD="<CLIENT_CERT_PASSWORD>" | ||
export CLIENT_CERT_ALIAS="<CLIENT_CERT_ALIAS>" | ||
export PRIVATE_KEY_ALIAS="<PRIVATE_KEY_ALIAS>" | ||
``` | ||
**Windows:** | ||
|
||
```shell | ||
set API_URL="<API_URL>" | ||
set CLIENT_CERT_PATH="<CLIENT_CERT_PATH>" | ||
set CLIENT_CERT_PASSWORD="<CLIENT_CERT_PASSWORD>" | ||
set CLIENT_CERT_ALIAS="<CLIENT_CERT_ALIAS>" | ||
set PRIVATE_KEY_ALIAS="<PRIVATE_KEY_ALIAS>" | ||
``` | ||
|
||
3. Run the JAR located inside the `build/libs` folder with the SSL debug argument: | ||
```shell | ||
java -jar client-cert-auth-sample.jar -Djavax.net.debug=all | ||
``` | ||
This will output detailed information about the SSL handshake and certificate validation process. |
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