SSL/TLS addon for Socks.
This package extends RawSocket
from Socks to provide a makeSecret()
method.
When called, this method initializes an SSL/TLS socket to send and receive data securely.
.Package(url: "https://github.com/czechboy0/SecretSocks.git", majorVersion: 0, minor: 1)
You also need to install the system openssl
package, see instructions here: https://github.com/qutheory/ssl#building
Since TCPInternetSocket
inherits from RawSocket
, the makeSecret()
method is available.
let address = InternetAddress(hostname: "api.spotify.com", port: 443)
let socket = try TCPInternetSocket(address: address)
try socket.connect()
let secureSocket = try socket.makeSecret()
try secureSocket.connect()
try secureSocket.send([0x00, 0x01, 0x02, ...])
let response = try secureSocket.receive(max: 2048)
Please create an issue with a description of your problem or open a pull request with a fix.
MIT