Skip to content

Commit

Permalink
Create 2024-03-15-java-https-check.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dougbreaux committed Mar 15, 2024
1 parent 4012a26 commit e7c3243
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions _posts/2024-03-15-java-https-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
tags:
- http
- java
- security
- tls
title: Check HTTP(S) Connectivity in Java
---
Trivial Java code to try an HTTP connection to a URL. In particular, this can be useful to see whether your Java environment and its SSL/TLS configuration will successfully connect to an https URL.

### Java class

See [TestHttp](https://github.com/dougbreaux/Java-Web-Tools/blob/master/src/main/java/TestHttp.java).

Run it like:
```console
java -Djavax.net.ssl.trustStore=/config/trust.jks -Djavax.net.ssl.keyStorePassword=$TRUST_PASSWORD TestHttp https://example.com
```

### JSP

JSP you can deploy or create in your Java server environment:

See [HttpTest.jsp](https://github.com/dougbreaux/Java-Web-Tools/blob/master/WebContent/HttpTest.jsp)

0 comments on commit e7c3243

Please sign in to comment.