I need to pass the data to the server2.c through another server1.c in the middle. Before calling SSL_write() I want to encrypt my data using public key file pubkey.pem of the server2.c so the server1.c cannot understand the data and simply writes it to the server2.c
What system call I should use that takes data and public key file as arguments?