smpp
smpp copied to clipboard
How to enable TLS for SMPP Server and Client ?
I need secure SMPP Server connections by enabling TLS. Can you please help me in doing so? Thanks in advance
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)
`