[erlang-questions] SSL client authentication help needed

Wes James comptekki@REDACTED
Tue Oct 23 17:51:20 CEST 2012


Hi.

On Tue, Oct 23, 2012 at 5:27 AM, Loïc Hoguin <essen@REDACTED> wrote:

> Hello,
>
> I am trying to set up client authentication on a website for testing, but
> my knowledge of SSL is quite poor.
>
> Can anyone give me clear steps to generate certificates and set things up,
> or at least pinpoint me to resources that would help me get started? Been
> trying for two days now and I'm kinda stuck.
>
> Thanks!


Not quite sure what you are doing.  To me certs would be on the server side
then you would need client code that does ssl. I use inets like this to
scrape an https web server:

inets:start(),
ssl:start(),
httpc:set_options([{cookies, enabled}]),
httpc:reset_cookies(),
URL="https://host.domain?username=username&passwd=password",
httpc:store_cookies([{"set-cookie","MYCOOKIE=acookie"},
{"set-cookie","AN_ID=;expires=Mon, 01-Jan-1990 08:00:00 GMT"} ], URL),
{ok,Results}=httpc:request(URL),
{_,_Cookie}=Results,
httpc:store_cookies([Cookie], URL),
URL2="https://host.domain?var1=var1data&var2=var2data",
{ok,Results2}=httpc:request(URL2),
......
inets:stop(),
ssl:stop().

hth,

wes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121023/00d1884b/attachment.htm>


More information about the erlang-questions mailing list