grpc / grpc/grpc-web

Looking for an example to include client cert in grpc-web

Open
#762 2 comments 3 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.