summaryrefslogtreecommitdiff
path: root/doc/html/M2Crypto.SSL.html
blob: a6b1cb341f16ee6ea0f9a82a1fddc3c5ea689ff2 (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>SSL Package &#8212; M2Crypto  documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="prev" title="M2Crypto Package" href="M2Crypto.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="ssl-package">
<h1>SSL Package<a class="headerlink" href="#ssl-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">SSL</span></code> Package<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="checker-module">
<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">Checker</span></code> Module<a class="headerlink" href="#checker-module" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-M2Crypto.SSL.Cipher">
<span id="cipher-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">Cipher</span></code> Module<a class="headerlink" href="#module-M2Crypto.SSL.Cipher" title="Permalink to this headline">¶</a></h2>
<p>SSL Ciphers</p>
<p>Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.</p>
<dl class="py class">
<dt id="M2Crypto.SSL.Cipher.Cipher">
<em class="property">class </em><code class="sig-prename descclassname">M2Crypto.SSL.Cipher.</code><code class="sig-name descname">Cipher</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cipher</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SSL/Cipher.html#Cipher"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Cipher.Cipher" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<dl class="py method">
<dt id="M2Crypto.SSL.Cipher.Cipher.name">
<code class="sig-name descname">name</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; str<a class="reference internal" href="_modules/M2Crypto/SSL/Cipher.html#Cipher.name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Cipher.Cipher.name" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Cipher.Cipher.version">
<code class="sig-name descname">version</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Cipher.html#Cipher.version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Cipher.Cipher.version" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="M2Crypto.SSL.Cipher.Cipher_Stack">
<em class="property">class </em><code class="sig-prename descclassname">M2Crypto.SSL.Cipher.</code><code class="sig-name descname">Cipher_Stack</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">stack</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SSL/Cipher.html#Cipher_Stack"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Cipher.Cipher_Stack" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
</dd></dl>

</div>
<div class="section" id="connection-module">
<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">Connection</span></code> Module<a class="headerlink" href="#connection-module" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-M2Crypto.SSL.Context">
<span id="context-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">Context</span></code> Module<a class="headerlink" href="#module-M2Crypto.SSL.Context" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt id="M2Crypto.SSL.Context.Context">
<em class="property">class </em><code class="sig-prename descclassname">M2Crypto.SSL.Context.</code><code class="sig-name descname">Context</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">protocol</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'tls'</span></em>, <em class="sig-param"><span class="n">weak_crypto</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>int<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">post_connection_check</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>Callable<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>‘Context’ for SSL connections.</p>
<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.add_session">
<code class="sig-name descname">add_session</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">session</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#M2Crypto.SSL.Session.Session" title="M2Crypto.SSL.Session.Session">M2Crypto.SSL.Session.Session</a></span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.add_session"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.add_session" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the session to the context.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>session</strong> – the session to be added.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>0 The operation failed. It was tried to add the same</dt><dd><p>(identical) session twice.</p>
</dd>
</dl>
<p>1 The operation succeeded.</p>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.close">
<code class="sig-name descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.close" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.get_allow_unknown_ca">
<code class="sig-name descname">get_allow_unknown_ca</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; Union<span class="p">[</span>int<span class="p">, </span>bool<span class="p">]</span><a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.get_allow_unknown_ca"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.get_allow_unknown_ca" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the context’s setting that accepts/rejects a peer
certificate if the certificate’s CA is unknown.</p>
<p>FIXME 2Bconverted to bool</p>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.get_cert_store">
<code class="sig-name descname">get_cert_store</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; X509.X509<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.get_cert_store"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.get_cert_store" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the certificate store associated with this context.</p>
<dl class="field-list simple">
<dt class="field-odd">Warning</dt>
<dd class="field-odd"><p>The store is NOT refcounted, and as such can not be relied
to be valid once the context goes away or is changed.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.get_session_cache_mode">
<code class="sig-name descname">get_session_cache_mode</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.get_session_cache_mode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.get_session_cache_mode" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the current session caching.</p>
<p>The mode is set to m2.SSL_SESS_CACHE_* constants.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the previously set cache mode value.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.get_session_timeout">
<code class="sig-name descname">get_session_timeout</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.get_session_timeout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.get_session_timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>Get current session timeout.</p>
<p>Whenever a new session is created, it is assigned a maximum
lifetime.  This lifetime is specified by storing the creation
time of the session and the timeout value valid at this time. If
the actual time is later than creation time plus timeout, the
session is not reused.</p>
<p>Due to this realization, all sessions behave according to the
timeout value valid at the time of the session negotiation.
Changes of the timeout value do not affect already established
sessions.</p>
<p>Expired sessions are removed from the internal session cache,
whenever SSL_CTX_flush_sessions(3) is called, either directly by
the application or automatically (see
SSL_CTX_set_session_cache_mode(3))</p>
<p>The default value for session timeout is decided on a per
protocol basis, see SSL_get_default_timeout(3).  All currently
supported protocols have the same default timeout value of 300
seconds.</p>
<p>SSL_CTX_set_timeout() returns the previously set timeout value.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the currently set timeout value.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.get_verify_depth">
<code class="sig-name descname">get_verify_depth</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.get_verify_depth"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.get_verify_depth" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the verification mode currently set in the SSL Context.</p>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.get_verify_mode">
<code class="sig-name descname">get_verify_mode</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.get_verify_mode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.get_verify_mode" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.load_cert">
<code class="sig-name descname">load_cert</code><span class="sig-paren">(</span><em class="sig-param">certfile: AnyStr</em>, <em class="sig-param">keyfile: Optional[AnyStr] = None</em>, <em class="sig-param">callback: Callable = &lt;function passphrase_callback&gt;</em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.load_cert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.load_cert" title="Permalink to this definition">¶</a></dt>
<dd><p>Load certificate and private key into the context.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>certfile</strong> – File that contains the PEM-encoded certificate.</p></li>
<li><p><strong>keyfile</strong> – File that contains the PEM-encoded private key.
Default value of None indicates that the private key
is to be found in ‘certfile’.</p></li>
<li><p><strong>callback</strong> – Callable object to be invoked if the private key is
passphrase-protected. Default callback provides a
simple terminal-style input for the passphrase.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.load_cert_chain">
<code class="sig-name descname">load_cert_chain</code><span class="sig-paren">(</span><em class="sig-param">certchainfile: AnyStr</em>, <em class="sig-param">keyfile: Optional[AnyStr] = None</em>, <em class="sig-param">callback: Callable = &lt;function passphrase_callback&gt;</em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.load_cert_chain"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.load_cert_chain" title="Permalink to this definition">¶</a></dt>
<dd><p>Load certificate chain and private key into the context.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>certchainfile</strong> – File object containing the PEM-encoded
certificate chain.</p></li>
<li><p><strong>keyfile</strong> – File object containing the PEM-encoded private
key. Default value of None indicates that the
private key is to be found in ‘certchainfile’.</p></li>
<li><p><strong>callback</strong> – Callable object to be invoked if the private key
is passphrase-protected. Default callback
provides a simple terminal-style input for the
passphrase.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.load_client_CA">
<code class="sig-name descname">load_client_CA</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cafile</span><span class="p">:</span> <span class="n">AnyStr</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#M2Crypto.SSL.Context.Context.load_client_CA" title="Permalink to this definition">¶</a></dt>
<dd><p>Load CA certs into the context. These CA certs are sent to the
peer during <em>SSLv3 certificate request</em>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cafile</strong> – File object containing one or more PEM-encoded CA
certificates concatenated together.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.load_client_ca">
<code class="sig-name descname">load_client_ca</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cafile</span><span class="p">:</span> <span class="n">AnyStr</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#M2Crypto.SSL.Context.Context.load_client_ca" title="Permalink to this definition">¶</a></dt>
<dd><p>Load CA certs into the context. These CA certs are sent to the
peer during <em>SSLv3 certificate request</em>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cafile</strong> – File object containing one or more PEM-encoded CA
certificates concatenated together.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.load_verify_info">
<code class="sig-name descname">load_verify_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cafile</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>AnyStr<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">capath</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>AnyStr<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#M2Crypto.SSL.Context.Context.load_verify_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Load CA certs into the context.</p>
<p>These CA certs are used during verification of the peer’s
certificate.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cafile</strong> – File containing one or more PEM-encoded CA
certificates concatenated together.</p></li>
<li><p><strong>capath</strong> – Directory containing PEM-encoded CA certificates
(one certificate per file).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>0 if the operation failed because CAfile and CApath are NULL</dt><dd><p>or the processing at one of the locations specified failed.
Check the error stack to find out the reason.</p>
</dd>
</dl>
<p>1 The operation succeeded.</p>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.load_verify_locations">
<code class="sig-name descname">load_verify_locations</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cafile</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>AnyStr<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">capath</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>AnyStr<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.load_verify_locations"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.load_verify_locations" title="Permalink to this definition">¶</a></dt>
<dd><p>Load CA certs into the context.</p>
<p>These CA certs are used during verification of the peer’s
certificate.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cafile</strong> – File containing one or more PEM-encoded CA
certificates concatenated together.</p></li>
<li><p><strong>capath</strong> – Directory containing PEM-encoded CA certificates
(one certificate per file).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>0 if the operation failed because CAfile and CApath are NULL</dt><dd><p>or the processing at one of the locations specified failed.
Check the error stack to find out the reason.</p>
</dd>
</dl>
<p>1 The operation succeeded.</p>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.m2_ssl_ctx_free">
<code class="sig-name descname">m2_ssl_ctx_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.SSL.Context.Context.m2_ssl_ctx_free" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.remove_session">
<code class="sig-name descname">remove_session</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">session</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#M2Crypto.SSL.Session.Session" title="M2Crypto.SSL.Session.Session">M2Crypto.SSL.Session.Session</a></span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.remove_session"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.remove_session" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove the session from the context.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>session</strong> – the session to be removed.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>0 The operation failed. The session was not found in</dt><dd><p>the cache.</p>
</dd>
</dl>
<p>1 The operation succeeded.</p>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_allow_unknown_ca">
<code class="sig-name descname">set_allow_unknown_ca</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ok</span><span class="p">:</span> <span class="n">Union<span class="p">[</span>int<span class="p">, </span>bool<span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_allow_unknown_ca"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_allow_unknown_ca" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the context to accept/reject a peer certificate if the
certificate’s CA is unknown.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>ok</strong> – True to accept, False to reject.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_cipher_list">
<code class="sig-name descname">set_cipher_list</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cipher_list</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_cipher_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_cipher_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the list of available ciphers.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cipher_list</strong> – The format of the string is described in
ciphers(1).</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>1 if any cipher could be selected and 0 on complete
failure.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_client_CA_list_from_file">
<code class="sig-name descname">set_client_CA_list_from_file</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cafile</span><span class="p">:</span> <span class="n">AnyStr</span></em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_client_CA_list_from_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_client_CA_list_from_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Load CA certs into the context. These CA certs are sent to the
peer during <em>SSLv3 certificate request</em>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cafile</strong> – File object containing one or more PEM-encoded CA
certificates concatenated together.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_default_verify_paths">
<code class="sig-name descname">set_default_verify_paths</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_default_verify_paths"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_default_verify_paths" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies that the default locations from which CA certs are
loaded should be used.</p>
<p>There is one default directory and one default file. The default
CA certificates directory is called “certs” in the default
OpenSSL directory. Alternatively the SSL_CERT_DIR environment
variable can be defined to override this location. The default
CA certificates file is called “cert.pem” in the default OpenSSL
directory. Alternatively the SSL_CERT_FILE environment variable
can be defined to override this location.</p>
<dl>
<dt>&#64;return 0 if the operation failed. A missing default location is</dt><dd><blockquote>
<div><p>still treated as a success. No error code is set.</p>
</div></blockquote>
<p>1 The operation succeeded.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_info_callback">
<code class="sig-name descname">set_info_callback</code><span class="sig-paren">(</span><em class="sig-param">callback: Callable = &lt;function ssl_info_callback&gt;</em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_info_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_info_callback" title="Permalink to this definition">¶</a></dt>
<dd><p>Set a callback function to get state information.</p>
<p>It can be used to get state information about the SSL
connections that are created from this context.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>callback</strong> – Callback function. The default prints
information to stderr.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_options">
<code class="sig-name descname">set_options</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">op</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_options" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds the options set via bitmask in options to the Context.</p>
<p>!!! Options already set before are not cleared!</p>
<p>The behaviour of the SSL library can be changed by setting
several options.  The options are coded as bitmasks and can be
combined by a logical or operation (|).</p>
<p>SSL.Context.set_options() and SSL.set_options() affect the
(external) protocol behaviour of the SSL library. The (internal)
behaviour of the API can be changed by using the similar
SSL.Context.set_mode() and SSL.set_mode() functions.</p>
<p>During a handshake, the option settings of the SSL object are
used. When a new SSL object is created from a context using
SSL(), the current option setting is copied. Changes to ctx
do not affect already created SSL objects. SSL.clear() does not
affect the settings.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>op</strong> – bitmask of additional options specified in
SSL_CTX_set_options(3) manpage.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>the new options bitmask after adding options.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_session_cache_mode">
<code class="sig-name descname">set_session_cache_mode</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_session_cache_mode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_session_cache_mode" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables/disables session caching.</p>
<p>The mode is set by using m2.SSL_SESS_CACHE_* constants.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> – new mode value.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>the previously set cache mode value.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_session_id_ctx">
<code class="sig-name descname">set_session_id_ctx</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">id</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_session_id_ctx"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_session_id_ctx" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the session id for the SSL.Context w/in a session can be reused.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>id</strong> – Sessions are generated within a certain context. When
exporting/importing sessions with
i2d_SSL_SESSION/d2i_SSL_SESSION it would be possible,
to re-import a session generated from another context
(e.g. another application), which might lead to
malfunctions. Therefore each application must set its
own session id context sid_ctx which is used to
distinguish the contexts and is stored in exported
sessions. The sid_ctx can be any kind of binary data
with a given length, it is therefore possible to use
e.g. the name of the application and/or the hostname
and/or service name.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_session_timeout">
<code class="sig-name descname">set_session_timeout</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">timeout</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_session_timeout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_session_timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>Set new session timeout.</p>
<p>See self.get_session_timeout() for explanation of the session
timeouts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>timeout</strong> – new timeout value.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>the previously set timeout value.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_tmp_dh">
<code class="sig-name descname">set_tmp_dh</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dhpfile</span><span class="p">:</span> <span class="n">AnyStr</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_tmp_dh"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_tmp_dh" title="Permalink to this definition">¶</a></dt>
<dd><p>Load ephemeral DH parameters into the context.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dhpfile</strong> – Filename of the file containing the PEM-encoded
DH parameters.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_tmp_dh_callback">
<code class="sig-name descname">set_tmp_dh_callback</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">callback</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>Callable<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_tmp_dh_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_tmp_dh_callback" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the callback function for SSL.Context.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>callback</strong> – Callable to be used when a DH parameters are required.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_tmp_rsa">
<code class="sig-name descname">set_tmp_rsa</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">rsa</span><span class="p">:</span> <span class="n"><a class="reference internal" href="M2Crypto.html#M2Crypto.RSA.RSA" title="M2Crypto.RSA.RSA">M2Crypto.RSA.RSA</a></span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_tmp_rsa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_tmp_rsa" title="Permalink to this definition">¶</a></dt>
<dd><p>Load ephemeral RSA key into the context.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>rsa</strong> – RSA.RSA instance.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_tmp_rsa_callback">
<code class="sig-name descname">set_tmp_rsa_callback</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">callback</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>Callable<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_tmp_rsa_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_tmp_rsa_callback" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the callback function to be used when
a temporary/ephemeral RSA key is required.</p>
</dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Context.Context.set_verify">
<code class="sig-name descname">set_verify</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">depth</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">callback</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>Callable<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#Context.set_verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.Context.set_verify" title="Permalink to this definition">¶</a></dt>
<dd><p>Set verify options. Most applications will need to call this
method with the right options to make a secure SSL connection.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mode</strong> – The verification mode to use. Typically at least
SSL.verify_peer is used. Clients would also typically
add SSL.verify_fail_if_no_peer_cert.</p></li>
<li><p><strong>depth</strong> – The maximum allowed depth of the certificate chain
returned by the peer.</p></li>
<li><p><strong>callback</strong> – Callable that can be used to specify custom
verification checks.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="M2Crypto.SSL.Context.ctxmap">
<code class="sig-prename descclassname">M2Crypto.SSL.Context.</code><code class="sig-name descname">ctxmap</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; M2Crypto.SSL.Context._ctxmap<a class="reference internal" href="_modules/M2Crypto/SSL/Context.html#ctxmap"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Context.ctxmap" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py function">
<dt id="M2Crypto.SSL.Context.map">
<code class="sig-prename descclassname">M2Crypto.SSL.Context.</code><code class="sig-name descname">map</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; M2Crypto.SSL.Context._ctxmap<a class="headerlink" href="#M2Crypto.SSL.Context.map" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="sslserver-module">
<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">SSLServer</span></code> Module<a class="headerlink" href="#sslserver-module" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-M2Crypto.SSL.Session">
<span id="session-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">Session</span></code> Module<a class="headerlink" href="#module-M2Crypto.SSL.Session" title="Permalink to this headline">¶</a></h2>
<p>SSL Session</p>
<p>Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.</p>
<dl class="py class">
<dt id="M2Crypto.SSL.Session.Session">
<em class="property">class </em><code class="sig-prename descclassname">M2Crypto.SSL.Session.</code><code class="sig-name descname">Session</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">session</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">_pyfree</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SSL/Session.html#Session"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Session.Session" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<dl class="py method">
<dt id="M2Crypto.SSL.Session.Session.as_der">
<code class="sig-name descname">as_der</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; bytes<a class="reference internal" href="_modules/M2Crypto/SSL/Session.html#Session.as_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Session.Session.as_der" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Session.Session.as_text">
<code class="sig-name descname">as_text</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; bytes<a class="reference internal" href="_modules/M2Crypto/SSL/Session.html#Session.as_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Session.Session.as_text" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Session.Session.get_time">
<code class="sig-name descname">get_time</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Session.html#Session.get_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Session.Session.get_time" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Session.Session.get_timeout">
<code class="sig-name descname">get_timeout</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Session.html#Session.get_timeout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Session.Session.get_timeout" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Session.Session.m2_ssl_session_free">
<code class="sig-name descname">m2_ssl_session_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.SSL.Session.Session.m2_ssl_session_free" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Session.Session.set_time">
<code class="sig-name descname">set_time</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">t</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Session.html#Session.set_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Session.Session.set_time" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Session.Session.set_timeout">
<code class="sig-name descname">set_timeout</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">t</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Session.html#Session.set_timeout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Session.Session.set_timeout" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="M2Crypto.SSL.Session.Session.write_bio">
<code class="sig-name descname">write_bio</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bio</span><span class="p">:</span> <span class="n">BIO.BIO</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/Session.html#Session.write_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Session.Session.write_bio" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py function">
<dt id="M2Crypto.SSL.Session.load_session">
<code class="sig-prename descclassname">M2Crypto.SSL.Session.</code><code class="sig-name descname">load_session</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">pemfile</span><span class="p">:</span> <span class="n">AnyStr</span></em><span class="sig-paren">)</span> &#x2192; <a class="reference internal" href="#M2Crypto.SSL.Session.Session" title="M2Crypto.SSL.Session.Session">M2Crypto.SSL.Session.Session</a><a class="reference internal" href="_modules/M2Crypto/SSL/Session.html#load_session"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.Session.load_session" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="twistedprotocolwrapper-module">
<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">TwistedProtocolWrapper</span></code> Module<a class="headerlink" href="#twistedprotocolwrapper-module" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-M2Crypto.SSL.cb">
<span id="cb-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">cb</span></code> Module<a class="headerlink" href="#module-M2Crypto.SSL.cb" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt id="M2Crypto.SSL.cb.ssl_info_callback">
<code class="sig-prename descclassname">M2Crypto.SSL.cb.</code><code class="sig-name descname">ssl_info_callback</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">where</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">ret</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">ssl_ptr</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> &#x2192; None<a class="reference internal" href="_modules/M2Crypto/SSL/cb.html#ssl_info_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.cb.ssl_info_callback" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py function">
<dt id="M2Crypto.SSL.cb.ssl_verify_callback">
<code class="sig-prename descclassname">M2Crypto.SSL.cb.</code><code class="sig-name descname">ssl_verify_callback</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ssl_ctx_ptr</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">x509_ptr</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">errnum</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">errdepth</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">ok</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/cb.html#ssl_verify_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.cb.ssl_verify_callback" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py function">
<dt id="M2Crypto.SSL.cb.ssl_verify_callback_allow_unknown_ca">
<code class="sig-prename descclassname">M2Crypto.SSL.cb.</code><code class="sig-name descname">ssl_verify_callback_allow_unknown_ca</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ok</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">store</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> &#x2192; int<a class="reference internal" href="_modules/M2Crypto/SSL/cb.html#ssl_verify_callback_allow_unknown_ca"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.cb.ssl_verify_callback_allow_unknown_ca" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py function">
<dt id="M2Crypto.SSL.cb.ssl_verify_callback_stub">
<code class="sig-prename descclassname">M2Crypto.SSL.cb.</code><code class="sig-name descname">ssl_verify_callback_stub</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ssl_ctx_ptr</span></em>, <em class="sig-param"><span class="n">x509_ptr</span></em>, <em class="sig-param"><span class="n">errnum</span></em>, <em class="sig-param"><span class="n">errdepth</span></em>, <em class="sig-param"><span class="n">ok</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SSL/cb.html#ssl_verify_callback_stub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SSL.cb.ssl_verify_callback_stub" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="ssl-dispatcher-module">
<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">ssl_dispatcher</span></code> Module<a class="headerlink" href="#ssl-dispatcher-module" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="timeout-module">
<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">timeout</span></code> Module<a class="headerlink" href="#timeout-module" title="Permalink to this headline">¶</a></h2>
</div>
</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">M2Crypto</a></h1>








<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="M2Crypto.html">M2Crypto Package</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#id1"><code class="xref py py-mod docutils literal notranslate"><span class="pre">M2Crypto</span></code> Package</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#asn1-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ASN1</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#authcookie-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">AuthCookie</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#bio-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">BIO</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#bn-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">BN</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#dh-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">DH</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#dsa-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">DSA</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#ec-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">EC</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#module-M2Crypto.EVP"><code class="xref py py-mod docutils literal notranslate"><span class="pre">EVP</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#engine-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Engine</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#module-M2Crypto.Err"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Err</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#rc4-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">RC4</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#module-M2Crypto.RSA"><code class="xref py py-mod docutils literal notranslate"><span class="pre">RSA</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#rand-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Rand</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#smime-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">SMIME</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#x509-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">X509</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#callback-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">callback</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#ftpslib-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ftpslib</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#httpslib-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">httpslib</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#module-M2Crypto.m2"><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#module-M2Crypto.m2crypto"><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2crypto</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#m2urllib-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2urllib</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#m2urllib2-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2urllib2</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#m2xmlrpclib-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2xmlrpclib</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#threading-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">threading</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="M2Crypto.html#module-M2Crypto.util"><code class="xref py py-mod docutils literal notranslate"><span class="pre">util</span></code> Module</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="M2Crypto.html#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">SSL Package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1"><code class="xref py py-mod docutils literal notranslate"><span class="pre">SSL</span></code> Package</a></li>
<li class="toctree-l4"><a class="reference internal" href="#checker-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Checker</span></code> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-M2Crypto.SSL.Cipher"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Cipher</span></code> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#connection-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Connection</span></code> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-M2Crypto.SSL.Context"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Context</span></code> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#sslserver-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">SSLServer</span></code> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-M2Crypto.SSL.Session"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Session</span></code> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#twistedprotocolwrapper-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">TwistedProtocolWrapper</span></code> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-M2Crypto.SSL.cb"><code class="xref py py-mod docutils literal notranslate"><span class="pre">cb</span></code> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#ssl-dispatcher-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ssl_dispatcher</span></code> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#timeout-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">timeout</span></code> Module</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
  <li><a href="M2Crypto.html">M2Crypto Package</a><ul>
      <li>Previous: <a href="M2Crypto.html" title="previous chapter">M2Crypto Package</a></li>
  </ul></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2017, Matej Cepl <mcepl@cepl.eu>.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 3.2.1</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="_sources/M2Crypto.SSL.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>