Skip to content

Commit

Permalink
interop: debug print the server's certificate hash
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Mar 17, 2024
1 parent cc11cf3 commit ae18918
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions interop/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package main

import (
"context"
"crypto/sha256"
"crypto/tls"
"encoding/base64"
"fmt"
"log"
"net/http"
Expand Down Expand Up @@ -47,6 +49,8 @@ func main() {
fmt.Println(err)
os.Exit(1)
}
hash := sha256.Sum256(cert.Certificate[0])
fmt.Printf("Server Certificate Hash: %#v (base64: %s)\n", hash, base64.RawStdEncoding.EncodeToString(hash[:]))
tlsConf = &tls.Config{
Certificates: []tls.Certificate{cert},
KeyLogWriter: keyLog,
Expand Down

0 comments on commit ae18918

Please sign in to comment.