Giter Site home page Giter Site logo

java-ssl-tools's Introduction

shellcheck
Cert

java-ssl-tools (jssl)

Say goodbye to "PKIX path building failed"!
Install, ping and uninstall certificates in java keystore lightning-fast.

demo

How to install

curl -sL https://raw.githubusercontent.com/pmamico/java-ssl-tools/main/install.sh | bash

on Windows, use Git Bash as system administrator.
or via homebrew:

brew install pmamico/java/jssl

Manual

jssl v1.4
Install trusted certificate and check SSL handshake against java keystore.

Usage: jssl <host> <operation> [-p|--port <arg>] [-a|--alias <arg>] [-h|--help] [-v|--version]
	<host>: without https:// and port, eg. google.com
	<operation>: ping, install or uninstall
	-p, --port: port (default: '443')
	-a, --alias: alias in keystore (default: '<host>')
	-l, --list: List installed certificates with jssl
	-h, --help: Prints help
	-v, --version: Prints version

Why not just use keytool?

Java has a built-in keytool to handle certificates on the java keystore.
However it has a few drawbacks:

In keytool there is no way to check that the certifiacate works

With jssl just type

$ jssl <URL> ping

With keytool you have to type a lot!

Especially annoying if you are in flow.
First you need to get the certificate somehow,
then to import it with keytool, thinking about alias names and the default password.
Eg.:

$ echo | openssl s_client -connect "<URL>:443"  2>/dev/null | openssl x509 > certificate.pem
$ /opt/homebrew/opt/openjdk@11/bin/keytool -importcert -cacerts -noprompt -alias <myalias> -file certificate.pem -keypass changeit -storepass changeit

is equivalent to

$ jssl <URL> install

Supports

Java 1.8 Java 11 Java 17 Java 21
Linux ✔️ ✔️ ✔️ ✔️
MacOS ✔️ ✔️ ✔️ ✔️
Windows ✔️ ✔️ ✔️ ✔️

Requirements

  • JAVA_HOME environment
  • openssl

java-ssl-tools's People

Contributors

pmamico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mubasherusman

java-ssl-tools's Issues

Failed to install on windows 10

Failed to install jssl, because there is no $HOME/bin directory.

$ uname
MINGW64_NT-10.0-19045

After creating $HOME/bin, installation is working and also jssl install command, however
jssl ping fails because SSLPing.java not found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.