func (s *SingleUseConnector) handleSSL() error {
	tlsConf, err := ssl.NewDbSSLMode(
		s.connectionDetails.SSLOptions,
		true)
	if err != nil {
		return err
	}
	if !tlsConf.UseTLS {
		return nil
	}
	message := protocol.NewMessageBuffer([]byte{})
	message.WriteInt32(8)
	message.WriteInt32(protocol.SSLRequestCode)
	_, err = s.backendConn.Write(message.Bytes())
	if err != nil {
		return err
	}
	response := make([]byte, 4096)
	_, err = s.backendConn.Read(response)
	if err != nil {
		return err
	}
	if len(response) > 0 && response[0] != 'S' {
		s.backendConn.Close()
		return fmt.Errorf("the backend does not allow SSL connections")
	}
	s.backendConn, err = ssl.HandleSSLUpgrade(s.backendConn, tlsConf)
	return err
}
handleSSL conditionally upgrades the backend connection to SSL depending on the
connection details.
package pg
import (
	"fmt"
	"net"
	"github.com/cyberark/secretless-broker/internal/plugin/connectors/tcp/pg/protocol"
	"github.com/cyberark/secretless-broker/internal/plugin/connectors/tcp/ssl"
)