gebi / sslpoke Goto Github PK
View Code? Open in Web Editor NEWTool to test SSL connections from within the java VM (with http proxy support)
License: Apache License 2.0
Tool to test SSL connections from within the java VM (with http proxy support)
License: Apache License 2.0
Since this is a very useful tool, and this solution is even listed by Atlassian as a good improvement to their original version of SSLPoke I thought it was worth reporting this issue.
I get the following compilation error when compiling with Java 17.
% java --version
openjdk 17.0.7 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)
% javac SSLPoke.java
SSLPoke.java:71: error: package sun.net.www.protocol.http is not visible
+ "User-Agent: " + sun.net.www.protocol.http.HttpURLConnection.userAgent + "\r\n"
^
(package sun.net.www.protocol.http is declared in module java.base, which does not export it to the unnamed module)
1 error`
According to this answer on Stack Overflow (https://stackoverflow.com/questions/10782957/what-to-use-instead-of-sun-net-www-protocol-http-httpurlconnection-useragent) I made the below changes that worked for me.
private static void open_http_connect_tunnel(Socket tunnel, String tunnel_host, int tunnel_port, String host, int port)
throws IOException
{
OutputStream out = tunnel.getOutputStream();
String javaVersion = "Java/" + System.getProperty("java.version");
String userAgent = System.getProperty("http.agent") == null ? javaVersion : System.getProperty("http.agent") + " " + javaVersion;
String msg = "CONNECT " + host + ":" + port + " HTTP/1.1\n"
+ "User-Agent: " + userAgent + "\r\n"
+ "\r\n";
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.