r509-ocsp-responder 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +112 -17
- data/doc/R509.html +6 -6
- data/doc/R509/Ocsp.html +10 -10
- data/doc/R509/Ocsp/Helper.html +9 -9
- data/doc/R509/Ocsp/Helper/RequestChecker.html +73 -73
- data/doc/R509/Ocsp/Helper/ResponseSigner.html +59 -59
- data/doc/R509/Ocsp/Responder.html +10 -10
- data/doc/R509/Ocsp/Responder/OcspConfig.html +31 -31
- data/doc/R509/Ocsp/Responder/Server.html +9 -9
- data/doc/R509/Ocsp/Responder/StatusError.html +9 -9
- data/doc/R509/Ocsp/Signer.html +36 -44
- data/doc/_index.html +23 -23
- data/doc/class_list.html +2 -2
- data/doc/css/style.css +10 -0
- data/doc/file.README.html +120 -28
- data/doc/file_list.html +1 -1
- data/doc/frames.html +1 -1
- data/doc/index.html +120 -28
- data/doc/js/full_list.js +6 -1
- data/doc/method_list.html +28 -56
- data/doc/top-level-namespace.html +5 -5
- data/lib/r509/ocsp/responder/ocsp-config.rb +27 -27
- data/lib/r509/ocsp/responder/server.rb +129 -131
- data/lib/r509/ocsp/responder/version.rb +4 -4
- data/lib/r509/ocsp/signer.rb +219 -219
- data/spec/fixtures.rb +145 -190
- data/spec/fixtures/test_ca_ec.cer +14 -0
- data/spec/fixtures/test_ca_ec.key +6 -0
- data/spec/server_spec.rb +405 -397
- data/spec/signer_spec.rb +262 -249
- data/spec/spec_helper.rb +2 -2
- metadata +10 -8
data/doc/R509/Ocsp/Signer.html
CHANGED
@@ -4,15 +4,15 @@
|
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
|
-
Class: R509::
|
7
|
+
Class: R509::OCSP::Signer
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.6.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<div id="menu">
|
33
33
|
|
34
34
|
<a href="../../_index.html">Index (S)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../../R509.html" title="R509 (module)">R509</a></span></span> » <span class='title'><span class='object_link'><a href="../
|
35
|
+
<span class='title'><span class='object_link'><a href="../../R509.html" title="R509 (module)">R509</a></span></span> » <span class='title'><span class='object_link'><a href="../OCSP.html" title="R509::OCSP (module)">OCSP</a></span></span>
|
36
36
|
»
|
37
37
|
<span class="title">Signer</span>
|
38
38
|
|
@@ -63,7 +63,7 @@
|
|
63
63
|
|
64
64
|
<iframe id="search_frame"></iframe>
|
65
65
|
|
66
|
-
<div id="content"><h1>Class: R509::
|
66
|
+
<div id="content"><h1>Class: R509::OCSP::Signer
|
67
67
|
|
68
68
|
|
69
69
|
|
@@ -78,7 +78,7 @@
|
|
78
78
|
<ul class="fullTree">
|
79
79
|
<li>Object</li>
|
80
80
|
|
81
|
-
<li class="next">R509::
|
81
|
+
<li class="next">R509::OCSP::Signer</li>
|
82
82
|
|
83
83
|
</ul>
|
84
84
|
<a href="#" class="inheritanceTree">show all</a>
|
@@ -250,7 +250,7 @@
|
|
250
250
|
<div class="method_details first">
|
251
251
|
<h3 class="signature first" id="initialize-instance_method">
|
252
252
|
|
253
|
-
- (<tt><span class='object_link'><a href="" title="R509::
|
253
|
+
- (<tt><span class='object_link'><a href="" title="R509::OCSP::Signer (class)">Signer</a></span></tt>) <strong>initialize</strong>(options)
|
254
254
|
|
255
255
|
|
256
256
|
|
@@ -307,13 +307,13 @@
|
|
307
307
|
|
308
308
|
<li>
|
309
309
|
<span class="name">:configs</span>
|
310
|
-
<span class="type">(<tt>R509::Config::
|
310
|
+
<span class="type">(<tt>R509::Config::CAConfigPool</tt>)</span>
|
311
311
|
<span class="default">
|
312
312
|
|
313
313
|
</span>
|
314
314
|
|
315
315
|
— <div class='inline'>
|
316
|
-
<p>
|
316
|
+
<p>CAConfigPool object</p>
|
317
317
|
</div>
|
318
318
|
|
319
319
|
</li>
|
@@ -342,13 +342,13 @@
|
|
342
342
|
<pre class="code"><span class="info file"># File 'lib/r509/ocsp/signer.rb', line 15</span>
|
343
343
|
|
344
344
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
345
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:validity_checker</span><span class='rparen'>)</span>
|
346
|
+
<span class='ivar'>@validity_checker</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:validity_checker</span><span class='rbracket'>]</span>
|
347
|
+
<span class='kw'>else</span>
|
348
|
+
<span class='ivar'>@validity_checker</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>Validity</span><span class='op'>::</span><span class='const'>DefaultChecker</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
349
|
+
<span class='kw'>end</span>
|
350
|
+
<span class='ivar'>@request_checker</span> <span class='op'>=</span> <span class='const'>Helper</span><span class='op'>::</span><span class='const'>RequestChecker</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:configs</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@validity_checker</span><span class='rparen'>)</span>
|
351
|
+
<span class='ivar'>@response_signer</span> <span class='op'>=</span> <span class='const'>Helper</span><span class='op'>::</span><span class='const'>ResponseSigner</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
352
352
|
<span class='kw'>end</span></pre>
|
353
353
|
</td>
|
354
354
|
</tr>
|
@@ -505,14 +505,6 @@
|
|
505
505
|
|
506
506
|
|
507
507
|
|
508
|
-
—
|
509
|
-
<div class='inline'><ul><li>
|
510
|
-
<p>:request [OpenSSL::OCSP::Request] parsed request object</p>
|
511
|
-
</li><li>
|
512
|
-
<p>:response [OpenSSL::OCSP::Response] full response object</p>
|
513
|
-
</li></ul>
|
514
|
-
</div>
|
515
|
-
|
516
508
|
</li>
|
517
509
|
|
518
510
|
</ul>
|
@@ -547,23 +539,23 @@
|
|
547
539
|
<pre class="code"><span class="info file"># File 'lib/r509/ocsp/signer.rb', line 30</span>
|
548
540
|
|
549
541
|
<span class='kw'>def</span> <span class='id identifier rubyid_handle_request'>handle_request</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
542
|
+
<span class='kw'>begin</span>
|
543
|
+
<span class='id identifier rubyid_parsed_request'>parsed_request</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>OCSP</span><span class='op'>::</span><span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_request'>request</span>
|
544
|
+
<span class='kw'>rescue</span>
|
545
|
+
<span class='kw'>return</span> <span class='lbrace'>{</span><span class='symbol'>:response</span> <span class='op'>=></span> <span class='ivar'>@response_signer</span><span class='period'>.</span><span class='id identifier rubyid_create_response'>create_response</span><span class='lparen'>(</span><span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>OCSP</span><span class='op'>::</span><span class='const'>RESPONSE_STATUS_MALFORMEDREQUEST</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='symbol'>:request</span> <span class='op'>=></span> <span class='kw'>nil</span><span class='rbrace'>}</span>
|
546
|
+
<span class='kw'>end</span>
|
547
|
+
|
548
|
+
<span class='id identifier rubyid_statuses'>statuses</span> <span class='op'>=</span> <span class='ivar'>@request_checker</span><span class='period'>.</span><span class='id identifier rubyid_check_statuses'>check_statuses</span><span class='lparen'>(</span><span class='id identifier rubyid_parsed_request'>parsed_request</span><span class='rparen'>)</span>
|
549
|
+
<span class='kw'>if</span> <span class='kw'>not</span> <span class='ivar'>@request_checker</span><span class='period'>.</span><span class='id identifier rubyid_validate_statuses'>validate_statuses</span><span class='lparen'>(</span><span class='id identifier rubyid_statuses'>statuses</span><span class='rparen'>)</span>
|
550
|
+
<span class='kw'>return</span> <span class='lbrace'>{</span><span class='symbol'>:response</span> <span class='op'>=></span> <span class='ivar'>@response_signer</span><span class='period'>.</span><span class='id identifier rubyid_create_response'>create_response</span><span class='lparen'>(</span><span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>OCSP</span><span class='op'>::</span><span class='const'>RESPONSE_STATUS_UNAUTHORIZED</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='symbol'>:request</span> <span class='op'>=></span> <span class='kw'>nil</span><span class='rbrace'>}</span>
|
551
|
+
<span class='kw'>end</span>
|
552
|
+
|
553
|
+
<span class='id identifier rubyid_basic_response'>basic_response</span> <span class='op'>=</span> <span class='ivar'>@response_signer</span><span class='period'>.</span><span class='id identifier rubyid_create_basic_response'>create_basic_response</span><span class='lparen'>(</span><span class='id identifier rubyid_parsed_request'>parsed_request</span><span class='comma'>,</span><span class='id identifier rubyid_statuses'>statuses</span><span class='rparen'>)</span>
|
554
|
+
|
555
|
+
<span class='lbrace'>{</span><span class='symbol'>:response</span> <span class='op'>=></span> <span class='ivar'>@response_signer</span><span class='period'>.</span><span class='id identifier rubyid_create_response'>create_response</span><span class='lparen'>(</span>
|
556
|
+
<span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>OCSP</span><span class='op'>::</span><span class='const'>RESPONSE_STATUS_SUCCESSFUL</span><span class='comma'>,</span>
|
557
|
+
<span class='id identifier rubyid_basic_response'>basic_response</span>
|
558
|
+
<span class='rparen'>)</span><span class='comma'>,</span> <span class='symbol'>:request</span> <span class='op'>=></span> <span class='id identifier rubyid_parsed_request'>parsed_request</span><span class='rbrace'>}</span>
|
567
559
|
<span class='kw'>end</span></pre>
|
568
560
|
</td>
|
569
561
|
</tr>
|
@@ -575,9 +567,9 @@
|
|
575
567
|
</div>
|
576
568
|
|
577
569
|
<div id="footer">
|
578
|
-
Generated on
|
570
|
+
Generated on Tue Apr 16 13:57:16 2013 by
|
579
571
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
580
|
-
0.8.
|
572
|
+
0.8.6.1 (ruby-1.9.3).
|
581
573
|
</div>
|
582
574
|
|
583
575
|
</body>
|
data/doc/_index.html
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
|
-
Documentation by YARD 0.8.
|
7
|
+
Documentation by YARD 0.8.6.1
|
8
8
|
|
9
9
|
</title>
|
10
10
|
|
11
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
11
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
15
|
<script type="text/javascript" charset="utf-8">
|
16
16
|
hasFrames = window.top.frames.main ? true : false;
|
@@ -56,7 +56,7 @@
|
|
56
56
|
|
57
57
|
<iframe id="search_frame"></iframe>
|
58
58
|
|
59
|
-
<div id="content"><h1 class="noborder title">Documentation by YARD 0.8.
|
59
|
+
<div id="content"><h1 class="noborder title">Documentation by YARD 0.8.6.1</h1>
|
60
60
|
<div id="listing">
|
61
61
|
<h1 class="alphaindex">Alphabetic Index</h1>
|
62
62
|
|
@@ -85,9 +85,9 @@
|
|
85
85
|
<ul>
|
86
86
|
|
87
87
|
<li>
|
88
|
-
<span class='object_link'><a href="R509/
|
88
|
+
<span class='object_link'><a href="R509/OCSP/Helper.html" title="R509::OCSP::Helper (module)">Helper</a></span>
|
89
89
|
|
90
|
-
<small>(R509::
|
90
|
+
<small>(R509::OCSP)</small>
|
91
91
|
|
92
92
|
</li>
|
93
93
|
|
@@ -100,16 +100,16 @@
|
|
100
100
|
<ul>
|
101
101
|
|
102
102
|
<li>
|
103
|
-
<span class='object_link'><a href="R509/
|
103
|
+
<span class='object_link'><a href="R509/OCSP.html" title="R509::OCSP (module)">OCSP</a></span>
|
104
104
|
|
105
105
|
<small>(R509)</small>
|
106
106
|
|
107
107
|
</li>
|
108
108
|
|
109
109
|
<li>
|
110
|
-
<span class='object_link'><a href="R509/
|
110
|
+
<span class='object_link'><a href="R509/OCSP/Responder/OCSPConfig.html" title="R509::OCSP::Responder::OCSPConfig (class)">OCSPConfig</a></span>
|
111
111
|
|
112
|
-
<small>(R509::
|
112
|
+
<small>(R509::OCSP::Responder)</small>
|
113
113
|
|
114
114
|
</li>
|
115
115
|
|
@@ -127,23 +127,23 @@
|
|
127
127
|
</li>
|
128
128
|
|
129
129
|
<li>
|
130
|
-
<span class='object_link'><a href="R509/
|
130
|
+
<span class='object_link'><a href="R509/OCSP/Helper/RequestChecker.html" title="R509::OCSP::Helper::RequestChecker (class)">RequestChecker</a></span>
|
131
131
|
|
132
|
-
<small>(R509::
|
132
|
+
<small>(R509::OCSP::Helper)</small>
|
133
133
|
|
134
134
|
</li>
|
135
135
|
|
136
136
|
<li>
|
137
|
-
<span class='object_link'><a href="R509/
|
137
|
+
<span class='object_link'><a href="R509/OCSP/Responder.html" title="R509::OCSP::Responder (module)">Responder</a></span>
|
138
138
|
|
139
|
-
<small>(R509::
|
139
|
+
<small>(R509::OCSP)</small>
|
140
140
|
|
141
141
|
</li>
|
142
142
|
|
143
143
|
<li>
|
144
|
-
<span class='object_link'><a href="R509/
|
144
|
+
<span class='object_link'><a href="R509/OCSP/Helper/ResponseSigner.html" title="R509::OCSP::Helper::ResponseSigner (class)">ResponseSigner</a></span>
|
145
145
|
|
146
|
-
<small>(R509::
|
146
|
+
<small>(R509::OCSP::Helper)</small>
|
147
147
|
|
148
148
|
</li>
|
149
149
|
|
@@ -156,23 +156,23 @@
|
|
156
156
|
<ul>
|
157
157
|
|
158
158
|
<li>
|
159
|
-
<span class='object_link'><a href="R509/
|
159
|
+
<span class='object_link'><a href="R509/OCSP/Responder/Server.html" title="R509::OCSP::Responder::Server (class)">Server</a></span>
|
160
160
|
|
161
|
-
<small>(R509::
|
161
|
+
<small>(R509::OCSP::Responder)</small>
|
162
162
|
|
163
163
|
</li>
|
164
164
|
|
165
165
|
<li>
|
166
|
-
<span class='object_link'><a href="R509/
|
166
|
+
<span class='object_link'><a href="R509/OCSP/Signer.html" title="R509::OCSP::Signer (class)">Signer</a></span>
|
167
167
|
|
168
|
-
<small>(R509::
|
168
|
+
<small>(R509::OCSP)</small>
|
169
169
|
|
170
170
|
</li>
|
171
171
|
|
172
172
|
<li>
|
173
|
-
<span class='object_link'><a href="R509/
|
173
|
+
<span class='object_link'><a href="R509/OCSP/Responder/StatusError.html" title="R509::OCSP::Responder::StatusError (class)">StatusError</a></span>
|
174
174
|
|
175
|
-
<small>(R509::
|
175
|
+
<small>(R509::OCSP::Responder)</small>
|
176
176
|
|
177
177
|
</li>
|
178
178
|
|
@@ -188,9 +188,9 @@
|
|
188
188
|
</div>
|
189
189
|
|
190
190
|
<div id="footer">
|
191
|
-
Generated on
|
191
|
+
Generated on Tue Apr 16 13:57:16 2013 by
|
192
192
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
193
|
-
0.8.
|
193
|
+
0.8.6.1 (ruby-1.9.3).
|
194
194
|
</div>
|
195
195
|
|
196
196
|
</body>
|
data/doc/class_list.html
CHANGED
@@ -44,8 +44,8 @@
|
|
44
44
|
<div id="search">Search: <input type="text" /></div>
|
45
45
|
|
46
46
|
<ul id="full_list" class="class">
|
47
|
-
<li><span class='object_link'><a href="top-level-namespace.html" title=" (root)">Top Level Namespace</a></span></li>
|
48
|
-
<li><a class='toggle'></a> <span class='object_link'><a href="R509.html" title="R509 (module)">R509</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><a class='toggle'></a> <span class='object_link'><a href="R509/
|
47
|
+
<li><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></li>
|
48
|
+
<li><a class='toggle'></a> <span class='object_link'><a href="R509.html" title="R509 (module)">R509</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><a class='toggle'></a> <span class='object_link'><a href="R509/OCSP.html" title="R509::OCSP (module)">OCSP</a></span><small class='search_info'>R509</small></li><ul><li><a class='toggle'></a> <span class='object_link'><a href="R509/OCSP/Helper.html" title="R509::OCSP::Helper (module)">Helper</a></span><small class='search_info'>R509::OCSP</small></li><ul><li><span class='object_link'><a href="R509/OCSP/Helper/RequestChecker.html" title="R509::OCSP::Helper::RequestChecker (class)">RequestChecker</a></span> < Object<small class='search_info'>R509::OCSP::Helper</small></li><li><span class='object_link'><a href="R509/OCSP/Helper/ResponseSigner.html" title="R509::OCSP::Helper::ResponseSigner (class)">ResponseSigner</a></span> < Object<small class='search_info'>R509::OCSP::Helper</small></li></ul><li><a class='toggle'></a> <span class='object_link'><a href="R509/OCSP/Responder.html" title="R509::OCSP::Responder (module)">Responder</a></span><small class='search_info'>R509::OCSP</small></li><ul><li><span class='object_link'><a href="R509/OCSP/Responder/OCSPConfig.html" title="R509::OCSP::Responder::OCSPConfig (class)">OCSPConfig</a></span> < Object<small class='search_info'>R509::OCSP::Responder</small></li><li><span class='object_link'><a href="R509/OCSP/Responder/Server.html" title="R509::OCSP::Responder::Server (class)">Server</a></span> < Base<small class='search_info'>R509::OCSP::Responder</small></li><li><span class='object_link'><a href="R509/OCSP/Responder/StatusError.html" title="R509::OCSP::Responder::StatusError (class)">StatusError</a></span> < StandardError<small class='search_info'>R509::OCSP::Responder</small></li></ul><li><span class='object_link'><a href="R509/OCSP/Signer.html" title="R509::OCSP::Signer (class)">Signer</a></span> < Object<small class='search_info'>R509::OCSP</small></li></ul></ul>
|
49
49
|
|
50
50
|
</ul>
|
51
51
|
</div>
|
data/doc/css/style.css
CHANGED
@@ -27,6 +27,16 @@ h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right;
|
|
27
27
|
.rdoc-term { padding-right: 25px; font-weight: bold; }
|
28
28
|
.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; }
|
29
29
|
|
30
|
+
/* style for <table> */
|
31
|
+
#filecontents table, .docstring table { border-collapse: collapse; }
|
32
|
+
#filecontents table th, #filecontents table td,
|
33
|
+
.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; }
|
34
|
+
#filecontents table tr:nth-child(odd),
|
35
|
+
.docstring table tr:nth-child(odd) { background: #eee; }
|
36
|
+
#filecontents table tr:nth-child(even),
|
37
|
+
.docstring table tr:nth-child(even) { background: #fff; }
|
38
|
+
#filecontents table th, .docstring table th { background: #fff; }
|
39
|
+
|
30
40
|
/* style for <ul> */
|
31
41
|
#filecontents li > p, .docstring li > p { margin: 0px; }
|
32
42
|
#filecontents ul, .docstring ul { padding-left: 20px; }
|
data/doc/file.README.html
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" />
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.6.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
@@ -67,19 +67,113 @@
|
|
67
67
|
|
68
68
|
<h2>Requirements</h2>
|
69
69
|
|
70
|
-
<p>r509-ocsp-responder depends on <a href="https://github.com/reaperhulk/r509">r509</a>, <a href="http://redis.io">redis</a>, <a href="https://github.com/sirsean/r509-validity-redis">r509-validity-redis</a> (or another library that implements R509::Validity), <a href="http://sinatrarb.com">sinatra</a>, <a href="https://github.com/sirsean/
|
70
|
+
<p>r509-ocsp-responder depends on <a href="https://github.com/reaperhulk/r509">r509</a>, <a href="http://redis.io">redis</a>, <a href="https://github.com/sirsean/r509-validity-redis">r509-validity-redis</a> (or another library that implements R509::Validity), <a href="http://sinatrarb.com">sinatra</a>, and <a href="https://github.com/sirsean/dependo">dependo</a>. Optionally, you can install <a href="https://github.com/sirsean/r509-ocsp-stats">r509-ocsp-stats</a> for stats collection. These must be installed as gems.</p>
|
71
71
|
|
72
72
|
<h2>Basic Usage</h2>
|
73
73
|
|
74
|
-
<
|
75
|
-
<li>Build the gem. If you have cloned the repo you can build the gem with <code>rake gem:build</code>. You will need</li>
|
76
|
-
<li>Install the gem. <code>rake gem:install</code></li>
|
77
|
-
<li>Set up your config.ru and config.yaml. At this time you'll need to copy the config.ru from the gem install to another dir with your config.yaml. You should also copy (and modify) the config.yaml.example file from the gem. You'll need to alter the config.ru's require line from <code>require './lib/r509/ocsp/responder/server'</code> to <code>require 'r509/ocsp/responder/server'</code> if you have it installed as a gem.</li>
|
78
|
-
</ol>
|
74
|
+
<h3>Build/Install</h3>
|
79
75
|
|
80
|
-
<p>
|
76
|
+
<p>If you have cloned the repo you can build the gem with <code>rake gem:build</code> and install with <code>rake gem:install</code> . Alternately you can use a prebuilt gem by typing <code>gem install r509-ocsp-responder</code> .</p>
|
81
77
|
|
82
|
-
<
|
78
|
+
<h3>Set Up config.ru</h3>
|
79
|
+
|
80
|
+
<p>Save the below into a config.ru (or rackup) file</p>
|
81
|
+
|
82
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>r509</span><span class='tstring_end'>"</span></span>
|
83
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>dependo</span><span class='tstring_end'>"</span></span>
|
84
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>r509/ocsp/responder/server</span><span class='tstring_end'>'</span></span>
|
85
|
+
|
86
|
+
<span class='const'>Dependo</span><span class='op'>::</span><span class='const'>Registry</span><span class='lbracket'>[</span><span class='symbol'>:log</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>STDOUT</span><span class='rparen'>)</span>
|
87
|
+
|
88
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>r509/validity/redis</span><span class='tstring_end'>"</span></span>
|
89
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>redis</span><span class='tstring_end'>'</span></span>
|
90
|
+
<span class='kw'>begin</span>
|
91
|
+
<span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>hiredis</span><span class='tstring_end'>"</span></span>
|
92
|
+
<span class='const'>Dependo</span><span class='op'>::</span><span class='const'>Registry</span><span class='lbracket'>[</span><span class='symbol'>:log</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Loading redis with hiredis driver</span><span class='tstring_end'>"</span></span>
|
93
|
+
<span class='id identifier rubyid_redis'>redis</span> <span class='op'>=</span> <span class='const'>Redis</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:driver</span> <span class='op'>=></span> <span class='symbol'>:hiredis</span><span class='rparen'>)</span>
|
94
|
+
<span class='kw'>rescue</span> <span class='const'>Gem</span><span class='op'>::</span><span class='const'>LoadError</span>
|
95
|
+
<span class='const'>Dependo</span><span class='op'>::</span><span class='const'>Registry</span><span class='lbracket'>[</span><span class='symbol'>:log</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Loading redis with standard ruby driver</span><span class='tstring_end'>"</span></span>
|
96
|
+
<span class='id identifier rubyid_redis'>redis</span> <span class='op'>=</span> <span class='const'>Redis</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
97
|
+
<span class='kw'>end</span>
|
98
|
+
<span class='const'>Dependo</span><span class='op'>::</span><span class='const'>Registry</span><span class='lbracket'>[</span><span class='symbol'>:validity_checker</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>Validity</span><span class='op'>::</span><span class='const'>Redis</span><span class='op'>::</span><span class='const'>Checker</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_redis'>redis</span><span class='rparen'>)</span>
|
99
|
+
|
100
|
+
|
101
|
+
<span class='const'>R509</span><span class='op'>::</span><span class='const'>OCSP</span><span class='op'>::</span><span class='const'>Responder</span><span class='op'>::</span><span class='const'>OCSPConfig</span><span class='period'>.</span><span class='id identifier rubyid_load_config'>load_config</span>
|
102
|
+
|
103
|
+
<span class='const'>R509</span><span class='op'>::</span><span class='const'>OCSP</span><span class='op'>::</span><span class='const'>Responder</span><span class='op'>::</span><span class='const'>OCSPConfig</span><span class='period'>.</span><span class='id identifier rubyid_print_config'>print_config</span>
|
104
|
+
|
105
|
+
<span class='comment'># Uncomment the next two lines if you want to collect stats via r509-ocsp-stats
|
106
|
+
</span><span class='comment'># require "r509/ocsp/stats/redis"
|
107
|
+
</span><span class='comment'># Dependo::Registry[:stats] = R509::OCSP::Stats::Redis.new
|
108
|
+
</span>
|
109
|
+
<span class='id identifier rubyid_responder'>responder</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>OCSP</span><span class='op'>::</span><span class='const'>Responder</span><span class='op'>::</span><span class='const'>Server</span>
|
110
|
+
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_responder'>responder</span>
|
111
|
+
</code></pre>
|
112
|
+
|
113
|
+
<h3>Configure config.yaml</h3>
|
114
|
+
|
115
|
+
<p>The config.yaml contains certificate authority nodes as well as options like copy_nonce (documented below). Each CA node has an arbitrary name like test_ca and contains a ca_cert and (optional) ocsp_cert node. If you want to sign OCSP responses directly from your root you'll set your config up like this:</p>
|
116
|
+
|
117
|
+
<pre class="code yaml"><code class="yaml">copy_nonce: true
|
118
|
+
cache_headers: true
|
119
|
+
max_cache_age: 60
|
120
|
+
certificate_authorities: {
|
121
|
+
second_ca: {
|
122
|
+
ca_cert: {
|
123
|
+
cert: "spec/fixtures/second_ca.cer",
|
124
|
+
key: "spec/fixtures/second_ca.key"
|
125
|
+
}
|
126
|
+
}
|
127
|
+
}
|
128
|
+
</code></pre>
|
129
|
+
|
130
|
+
<p>If you want to use an OCSP delegate</p>
|
131
|
+
|
132
|
+
<pre class="code yaml"><code class="yaml">copy_nonce: true
|
133
|
+
cache_headers: true
|
134
|
+
max_cache_age: 60
|
135
|
+
certificate_authorities: {
|
136
|
+
test_ca: {
|
137
|
+
ca_cert: {
|
138
|
+
cert: "spec/fixtures/test_ca.cer"
|
139
|
+
},
|
140
|
+
ocsp_cert: {
|
141
|
+
cert: "spec/fixtures/test_ca_ocsp.cer",
|
142
|
+
key: "spec/fixtures/test_ca_ocsp.key"
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
</code></pre>
|
147
|
+
|
148
|
+
<p>Finally, if you're responding for multiple roots you specify them like so:</p>
|
149
|
+
|
150
|
+
<pre class="code yaml"><code class="yaml">copy_nonce: true
|
151
|
+
cache_headers: true
|
152
|
+
max_cache_age: 60
|
153
|
+
certificate_authorities: {
|
154
|
+
test_ca: {
|
155
|
+
ca_cert: {
|
156
|
+
cert: "spec/fixtures/test_ca.cer"
|
157
|
+
},
|
158
|
+
ocsp_cert: {
|
159
|
+
cert: "spec/fixtures/test_ca_ocsp.cer",
|
160
|
+
key: "spec/fixtures/test_ca_ocsp.key"
|
161
|
+
}
|
162
|
+
},
|
163
|
+
second_ca: {
|
164
|
+
ca_cert: {
|
165
|
+
cert: "spec/fixtures/second_ca.cer",
|
166
|
+
key: "spec/fixtures/second_ca.key"
|
167
|
+
}
|
168
|
+
}
|
169
|
+
}
|
170
|
+
</code></pre>
|
171
|
+
|
172
|
+
<h3>Configure Thin & nginx</h3>
|
173
|
+
|
174
|
+
<p>The example below is an example yaml config for thin. You will want to have as many servers as you have cores.</p>
|
175
|
+
|
176
|
+
<pre class="code yaml"><code class="yaml">chdir: /var/www/r509-ocsp-responder
|
83
177
|
rackup: /var/www/r509-ocsp-responder/config.ru
|
84
178
|
socket: /var/run/r509-ocsp-responder.sock
|
85
179
|
pid: /var/run/r509-ocsp-responder.pid
|
@@ -90,28 +184,28 @@ log: /var/log/r509-ocsp-responder.log
|
|
90
184
|
|
91
185
|
<p>Since this config is just using sockets let's set up nginx as a reverse proxy for the thin instances. We can also use this as a caching layer if we choose to enable cache_headers.</p>
|
92
186
|
|
93
|
-
<pre class="code ruby"><code>proxy_cache_path /var/www/cache levels=1:2 keys_zone=ocsp:8m max_size=16m inactive=64m;
|
187
|
+
<pre class="code ruby"><code class="ruby">proxy_cache_path /var/www/cache levels=1:2 keys_zone=ocsp:8m max_size=16m inactive=64m;
|
94
188
|
proxy_temp_path /var/www/cache/tmp;
|
95
189
|
|
96
190
|
upstream thin_ocsp_responder{
|
97
|
-
|
98
|
-
|
191
|
+
server unix:/var/run/r509-ocsp-responder.0.sock fail_timeout=0;
|
192
|
+
server unix:/var/run/r509-ocsp-responder.1.sock fail_timeout=0;
|
99
193
|
}
|
100
194
|
server {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
195
|
+
listen 80;
|
196
|
+
server_name ocsp.r509.org;
|
197
|
+
|
198
|
+
location / {
|
199
|
+
proxy_pass http://thin_ocsp_responder;
|
200
|
+
proxy_cache ocsp;
|
201
|
+
proxy_cache_use_stale updating;
|
202
|
+
}
|
109
203
|
}
|
110
204
|
</code></pre>
|
111
205
|
|
112
206
|
<p>Within the location block you may also choose to add these directives:</p>
|
113
207
|
|
114
|
-
<pre class="code ruby"><code>proxy_cache_methods GET POST;
|
208
|
+
<pre class="code ruby"><code class="ruby">proxy_cache_methods GET POST;
|
115
209
|
proxy_cache_valid 200 302 1m;
|
116
210
|
</code></pre>
|
117
211
|
|
@@ -129,8 +223,6 @@ proxy_cache_valid 200 302 1m;
|
|
129
223
|
<li><p><strong>max_cache_age</strong> - (integer) Sets the maximum age in <strong>seconds</strong> a response can be cached. At this time r509-ocsp-responder does not support cache invalidation so it is recommended to set this to a low value to reduce the time you may serve stale responses in the event of a revocation.</p></li>
|
130
224
|
</ul>
|
131
225
|
|
132
|
-
<p>See the config.yaml.example for an example configuration.</p>
|
133
|
-
|
134
226
|
<h2>Signals</h2>
|
135
227
|
|
136
228
|
<p>You can send a kill -USR2 signal to any running r509-ocsp-responder process to cause it to reload and print its config to the logs (provided your app server isn't trapping USR2 first).</p>
|
@@ -147,9 +239,9 @@ proxy_cache_valid 200 302 1m;
|
|
147
239
|
</div></div>
|
148
240
|
|
149
241
|
<div id="footer">
|
150
|
-
Generated on
|
242
|
+
Generated on Tue Apr 16 13:57:16 2013 by
|
151
243
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
152
|
-
0.8.
|
244
|
+
0.8.6.1 (ruby-1.9.3).
|
153
245
|
</div>
|
154
246
|
|
155
247
|
</body>
|