1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
<tt>
<div dir="ltr"><div>But then I would have to check the client cert for each and every request. I should have to check the cert only once at connect time and then be able to pass the result of that check in the request to each handler.<br><br>
<br></div>Anyway I've gone ahead and implemented what I need in a generic manner and it seems to work well. I think it would be a useful addition to Cowboy. If you agree I could write some more documentation for it.<br><br>
<div><br><a href="https://github.com/goertzenator/cowboy/tree/onconnect">https://github.com/goertzenator/cowboy/tree/onconnect</a><br><br></div><div>I added a "onconnect" hook and "connection metadata" to cowboy_req. The connection metadata works like existing metadata, but is preserved from request to request on the same connection. The onconnect hook provides initial values for the connection metadata.<br><br>
<br></div><div>Dan.<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 5, 2014 at 3:04 AM, Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span> wrote:<br><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 06/05/2014 01:44 AM, Daniel Goertzen wrote:<br><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
<br><br>
<br><br>
<br><br>
On Wed, Jun 4, 2014 at 4:48 PM, Loïc Hoguin <<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a><br></div><div class=""><br>
<mailto:<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>>> wrote:<br><br>
<br><br>
On 06/04/2014 10:08 PM, Daniel Goertzen wrote:<br><br>
<br><br>
I am having very good luck with Cowboy so far, but I have some<br><br>
questions:<br><br>
<br><br>
1. There doesn't appear to be any way to do client certificate<br><br>
authorization in Cowboy, although I see there is an example for<br><br>
doing<br><br>
exactly that with Ranch. I think I could modify Cowboy to do what I<br><br>
want, but I thought I would ask if there were other options<br><br>
before doing<br><br>
that.<br><br>
<br><br>
<br><br>
Same as Ranch really, you just gotta take the socket and then call<br><br>
the ssl functions.<br><br>
<br><br>
<br><br>
Yes, but in cowboy there's no API to get at the socket.<br><br>
</div></blockquote><br>
<br><br>
There is the undocumented function cowboy_req:get/1 which is meant for that kind of "special" use.<div class="HOEnZb"><div class="h5"><br><br>
<br><br>
-- <br><br>
Loïc Hoguin<br><br>
<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br>
</div></div></blockquote></div><br></div><br>
</tt>
|