Name: ssh-agent-tls
Owner: Spotify
Description: A library that generates X.509 certificates and signs them with SSH agent. For use in client-side TLS handshakes.
Created: 2016-12-06 01:04:35.0
Updated: 2018-05-19 22:58:16.0
Pushed: 2018-05-19 22:58:15.0
Size: 81
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This Java library provides tools for client-side TLS operations. This project is currently stable and used in Helios.
Download the latest JAR or grab via Maven.
endency>
roupId>com.spotify</groupId>
rtifactId>ssh-agent-tls</artifactId>
ersion>0.0.1</version>
pendency>
This example shows how to present a static TLS certificate stored on disk.
Specify the paths of the certificate “cert.pem” and private key “key.pem” for CertKeyPaths
.
Then create an instance of CertFileHttpsHandler
, an implementation of HttpsHandler
,
and use it to handle()
the HttpsURLConnection
.
l URL url = new URL("https://example.net");
l HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
l CertKeyPaths certKeyPaths = CertKeyPaths.create(Paths.get("/cert.pem"), Paths.get("/key.pem"));
l CertFileHttpsHandler certFileHttpsHandler =
HttpsHandlers.createCertFileHttpsHandler("username", false, certKeyPaths);
FileHttpsHandler.handle(conn);
This example shows how to use an SSH key pair via ssh-agent (only RSA keys are supported right now)
to sign a randomly generated X.509 certificate. Create an instance of SshAgentHttpsHandler
,
an implementation of HttpsHandler
, and use it to handle()
the HttpsURLConnection
.
rt com.spotify.sshagentproxy.AgentProxies;
rt com.spotify.sshagentproxy.Identity;
l URL url = new URL("https://example.net");
l HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
l AgentProxy agentProxy = AgentProxies.newInstance();
l List<Identity> identities = agentProxy.list();
l SshAgentHttpsHandler sshAgentHttpsHandler =
HttpsHandlers.createSshAgentHttpsHandler("username", false, agentProxy, identities.get(0));
gentHttpsHandler.handle(conn);
Any platform that has the following
This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.