I am using server-to-server communication, which should (probably) look like this:
client (web browser) β (web application) server (service client) β (service application) central server
Some client requests are processed locally, and some are executed as remote service calls (rather than RPC). The request to the central server is formatted as HTTPS POST, and then sent using cURL; the server responds with a corresponding JSON message.
The problem is that I use HTTPS, and it takes extra time to verify the certificate, each time a service request is made. It is possible to reuse the cURL descriptor and send the keep-alive connection header, but .. In the current MVC implementation, each new client request results in a new instance of the web application (and the corresponding service client) - which means the https connection is also initialized.
So, the following questions arise:
- Is there a way to speed up such HTTPS requests? For example, somehow bypassing the check after the first successful connection?
- Can I refuse HTTPS (in particular, its temporary certificate verification procedure) and encrypt / decrypt POST and JSON myself (for example, using mcrypt) in combination with some authorization method (Diffie-Hellman)?
- Am I doing something completely wrong and should stop immediately?
Thanks!
Xifax source share