Looking for an example to include client cert in grpc-web
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 802
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Description
I am looking for an example to include client certs when making a connection from browser
The constructor is defined this way, but how to include client certs so that the server can validate the client is not known and there are no references available for this constructor:
constructor (hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: string; });
For example, the golang equivalent is:
cert, err := tls.LoadX509KeyPair("", "")
certList := make([]tls.Certificate, 1)
certList = append(certList, cert)
config := &tls.Config{
InsecureSkipVerify: true,
Certificates: certList,
}
conn, err = grpc.Dial("host", grpc.WithTransportCredentials(credentials.NewTLS(config)))
c := service.NewClient(conn)
Contributor guide
Assessment
This issue has not been assessed yet.