Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/luisguillenc/grpctls

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/luisguillenc/grpctls

  • v0.0.0-20191021152419-e99d6682ee98
  • Source
  • Go
  • Socket score

Version published
Created
Source

grpctls

GRPCTLS provides helper structs and functions for grpc dialing with TLS options.

Usage

func main() {
	uri := "tcp://0.0.0.0:8069"
	cfg := grpctls.ServerCfg{
		CertFile:   "server.crt",
		KeyFile:    "server.key",
		CACert:     "ca.crt",
		ClientAuth: true,
	}

	var err error
	var creds credentials.TransportCredentials
	if cfg.UseTLS() {
		creds, err = grpctls.Creds(cfg)
		if err != nil {
			log.Fatalf("initializing TLS: %v\n", err)
		}
	}
	lis, err := grpctls.Listener(uri)
	if err != nil {
		log.Fatalf("can't listen server: %v\n", err)
	}
	grpcs := grpc.NewServer(grpc.Creds(creds))
	grpcs.Serve(lis)
}

See examples directory for common use.

FAQs

Package last updated on 21 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc