ssh-agent-tls

A library that generates X.509 certificates and signs them with SSH agent. For use in client-side TLS handshakes.

License

License

GroupId

GroupId

com.spotify
ArtifactId

ArtifactId

ssh-agent-tls
Last Version

Last Version

0.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

ssh-agent-tls
A library that generates X.509 certificates and signs them with SSH agent. For use in client-side TLS handshakes.
Project URL

Project URL

https://github.com/spotify/ssh-agent-tls
Source Code Management

Source Code Management

https://github.com/spotify/ssh-agent-tls

Download ssh-agent-tls

How to add to project

<!-- https://jarcasting.com/artifacts/com.spotify/ssh-agent-tls/ -->
<dependency>
    <groupId>com.spotify</groupId>
    <artifactId>ssh-agent-tls</artifactId>
    <version>0.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/com.spotify/ssh-agent-tls/
implementation 'com.spotify:ssh-agent-tls:0.0.4'
// https://jarcasting.com/artifacts/com.spotify/ssh-agent-tls/
implementation ("com.spotify:ssh-agent-tls:0.0.4")
'com.spotify:ssh-agent-tls:jar:0.0.4'
<dependency org="com.spotify" name="ssh-agent-tls" rev="0.0.4">
  <artifact name="ssh-agent-tls" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.spotify', module='ssh-agent-tls', version='0.0.4')
)
libraryDependencies += "com.spotify" % "ssh-agent-tls" % "0.0.4"
[com.spotify/ssh-agent-tls "0.0.4"]

Dependencies

compile (9)

Group / Artifact Type Version
javax.annotation : javax.annotation-api jar 1.2
org.slf4j : slf4j-api jar 1.7.21
com.google.guava : guava jar 20.0
org.bouncycastle : bcprov-debug-jdk15on jar 1.53
org.bouncycastle : bcpkix-jdk15on jar 1.53
org.apache.httpcomponents : httpclient jar 4.5
com.spotify : ssh-agent-proxy jar 0.1.5
com.eaio.uuid : uuid jar 3.2
commons-codec : commons-codec jar 1.10

provided (1)

Group / Artifact Type Version
com.google.auto.value : auto-value jar 1.3

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-core jar 1.9.5

Project Modules

There are no modules declared in this project.

ssh-agent-tls

Build Status codecov Maven Central License

This Java library provides tools for client-side TLS operations. This project is currently stable and used in Helios.

Download

Download the latest JAR or grab via Maven.

<dependency>
  <groupId>com.spotify</groupId>
  <artifactId>ssh-agent-tls</artifactId>
  <version>0.0.1</version>
</dependency>

Getting started

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.

final URL url = new URL("https://example.net");
final HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();

final CertKeyPaths certKeyPaths = CertKeyPaths.create(Paths.get("/cert.pem"), Paths.get("/key.pem"));
final CertFileHttpsHandler certFileHttpsHandler =
    HttpsHandlers.createCertFileHttpsHandler("username", false, certKeyPaths);
certFileHttpsHandler.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.

import com.spotify.sshagentproxy.AgentProxies;
import com.spotify.sshagentproxy.Identity;

final URL url = new URL("https://example.net");
final HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();

final AgentProxy agentProxy = AgentProxies.newInstance();
final List<Identity> identities = agentProxy.list();
final SshAgentHttpsHandler sshAgentHttpsHandler =
    HttpsHandlers.createSshAgentHttpsHandler("username", false, agentProxy, identities.get(0));
sshAgentHttpsHandler.handle(conn);

Prerequisities

Any platform that has the following

  • Java 7+
  • Maven 3 (for compiling)

Code of conduct

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.

com.spotify

Spotify

Versions

Version
0.0.4
0.0.3
0.0.2
0.0.1