I took the certificate and key from the PEM file and decrypted base64 to binary and put them in Certand Key.
Then, to open the connection, I have the following code.
make_connection(Cert, Key) ->
Options = [{cert, Cert}, {key, Key}, {mode, binary}],
Timeout = 1000,
% {ok, Socket} replaced for debugging...
Socket = ssl:connect(?PUSH_SERVER_HOST, ?PUSH_SERVER_PORT,
Options, Timeout),
Socket.
The call make_connection(Cert, Key)returns {error, {eoptions, {key, <<...>>}}}.
When I replace Certboth Keywith the path to the PEM file and Options = [{certfile, ... keyfile ...}], it works and creates the SSL socket as intended.
So I donβt miss anything using Certand Keyalone?
source
share