mirror of
https://github.com/go-micro/go-micro.git
synced 2025-01-05 10:20:53 +02:00
f23638c036
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
22 lines
385 B
Go
22 lines
385 B
Go
package grpc
|
|
|
|
import (
|
|
"crypto/tls"
|
|
|
|
gc "github.com/micro/go-micro/v2/client/grpc"
|
|
gs "github.com/micro/go-micro/v2/server/grpc"
|
|
"github.com/micro/go-micro/v2/service"
|
|
)
|
|
|
|
// WithTLS sets the TLS config for the service
|
|
func WithTLS(t *tls.Config) service.Option {
|
|
return func(o *service.Options) {
|
|
o.Client.Init(
|
|
gc.AuthTLS(t),
|
|
)
|
|
o.Server.Init(
|
|
gs.AuthTLS(t),
|
|
)
|
|
}
|
|
}
|