smpp icon indicating copy to clipboard operation
smpp copied to clipboard

How to enable TLS for SMPP Server and Client ?

Open vanipolnedi opened this issue 2 years ago • 1 comments

I need secure SMPP Server connections by enabling TLS. Can you please help me in doing so? Thanks in advance

vanipolnedi avatar Apr 27 '22 05:04 vanipolnedi

Hey @vanipolnedi

I think that you can use the .Serve from Server method and pass your tls conf inside it.

` srv := smpp.NewServer(s.Address, sessConf) cert, err := tls.LoadX509KeyPair("path/to/server.crt", "path/to/server.key") if err != nil { log.Fatalf("failed to load key pair: %v", err) }

tlsConfig := &tls.Config{
	Certificates: []tls.Certificate{cert},
}

ln, err := tls.Listen("tcp", ":2775", tlsConfig)
if err != nil {
	log.Fatalf("failed to listen: %v", err)
}
return srv.Serve(ln)

`

cellezam avatar May 29 '24 09:05 cellezam