Looking for an example to include client cert in grpc-web
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("<pem_file>", "<pem_file>") 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)
Source: grpc/grpc-web