Skip to content

Commit

Permalink
acme/tls-1 -> acme-tls/1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzorin committed Jun 15, 2018
1 parent 26a6325 commit 11db2e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It works in the following way:
- This listener pre-reads the first (up to ~16KiB) packet and checks whether:
- It is a ClientHello TLS record
- It contains the ALPN TLS extension
- It contains the `acme/tls-1` ALPN protocol
- It contains the `acme-tls/1` ALPN protocol
- If these prerequisites are fulfilled, the program will proxy the TCP connection to `127.0.0.1:31443/tcp` (where you should run e.g. Certbot's standalone TLS-ALPN-01 authenticator)
- Otherwise, the listener will proxy the TCP connection to `127.0.0.1:443/tcp`.
- In both cases, the program will copy the ClientHello TLS record as well.
Expand Down Expand Up @@ -41,12 +41,12 @@ certbot certonly -d example.org -a standalone \

### Customization

#### Change the fallback destination for non acme/tls-1 connections
#### Change the fallback destination for non acme-tls/1 connections
By default it is `127.0.0.1:443`, but you can customize it by using e.g.

acme-alpn-proxy -fallback 127.0.0.1:8443 start

#### Change the destination for acme/tls-1 connections
#### Change the destination for acme-tls/1 connections
By default, `127.0.0.1:31443`, but can be customized:

acme-alpn-proxy -alpn 127.0.0.1:8443 start
Expand Down
4 changes: 2 additions & 2 deletions acme-alpn-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func main() {
}

// For each connection, we pre-read the ClientHello frame
// and look for the acme/tls-1 proto to be present in the
// and look for the acme-tls/1 proto to be present in the
// ALPN extension.
// If it's present, we open a connection to the ALPN standalone server.
// Otherwise, we forward the connection onto the intended destination.
Expand All @@ -179,7 +179,7 @@ func handleConn(conn net.Conn) {

var dest string

if isACME := isClientHelloWithALPN(buf, "acme/tls-1"); !isACME {
if isACME := isClientHelloWithALPN(buf, "acme-tls/1"); !isACME {
dest = fallbackDest
log.Printf("[%v] Not ACME TLS-ALPN, passing-through to %s", conn.RemoteAddr(), dest)
} else {
Expand Down

0 comments on commit 11db2e0

Please sign in to comment.