rnaga / php-tls
PHP TLS library
dev-master
2017-12-30 04:47 UTC
Requires
- php: >=7.0.0
- ext-gmp: *
- mdanter/ecc: *
- spomky-labs/php-aes-gcm: *
This package is not auto-updated.
Last update: 2025-01-13 14:42:51 UTC
README
TLS library written in PHP.
Features:
- TLSv1.1 and TLSv1.2
- ECDHE(secp256r1, secp384r1)
- Signature Alogorithm(TLSv1.2)
- AEAD(GCM)
- ECDSA
Supported Cipher Suite:
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
- TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
- TLS_RSA_WITH_AES_256_GCM_SHA384
- TLS_RSA_WITH_AES_128_GCM_SHA256
- TLS_RSA_WITH_AES_256_CBC_SHA256
- TLS_RSA_WITH_AES_256_CBC_SHA
- TLS_RSA_WITH_AES_128_CBC_SHA256
- TLS_RSA_WITH_AES_128_CBC_SHA
Usage:
// Create a TLS Engine $tls = TLSContext::createTLS(TLSContext::getServerConfig([])); // Receive raw data from a client $data = stream_socket_recvfrom($clientSocket); // Pass raw data to TLS Engine for conversion $tls->encode($data); // Get the plaintext from TLS Engine $in = $tls->input(); // Convert plaintext into TLS format $out = $tls->output("Hello World")->decode(); // Send the output to a client stream_socket_sendto($clientSocket, $out);