github.com/anycable/anycable-go@v1.5.1/server/ssl_config.go (about)

     1  package server
     2  
     3  // SSLConfig contains SSL parameters
     4  type SSLConfig struct {
     5  	CertPath string
     6  	KeyPath  string
     7  }
     8  
     9  // NewSSLConfig build a new SSLConfig struct
    10  func NewSSLConfig() SSLConfig {
    11  	return SSLConfig{}
    12  }
    13  
    14  // Available returns true iff certificate and private keys are set
    15  func (opts *SSLConfig) Available() bool {
    16  	return opts.CertPath != "" && opts.KeyPath != ""
    17  }