Files
quic-go/http3/internal/testdata/generate_key.sh
Robin Thellend 0a9c6ea4c8 http3: remove dependency on quic internal packages (#5256)
* Remove http3 dependency on quic internal packages

Remove the dependency on internal/protocol from the http3 package. This
makes it possible for a forked http3 to use the mainline quic-go
package.

* Address review comments

* Fix syntax

* Use broader pattern for http3 directory

* Copy internal/testdata

* Replace perspective with bool

* clone the supported version slice

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2025-07-07 13:41:23 +02:00

25 lines
676 B
Bash
Executable File

#!/bin/bash
set -e
echo "Generating CA key and certificate:"
openssl req -x509 -sha256 -nodes -days 3650 -newkey rsa:2048 \
-keyout ca.key -out ca.pem \
-subj "/O=quic-go Certificate Authority/"
echo "Generating CSR"
openssl req -out cert.csr -new -newkey rsa:2048 -nodes -keyout priv.key \
-subj "/O=quic-go/"
echo "Sign certificate:"
openssl x509 -req -sha256 -days 3650 -in cert.csr -out cert.pem \
-CA ca.pem -CAkey ca.key -CAcreateserial \
-extfile <(printf "subjectAltName=DNS:localhost")
# debug output the certificate
openssl x509 -noout -text -in cert.pem
# we don't need the CA key, the serial number and the CSR any more
rm ca.key cert.csr ca.srl