Commits
Joshua Root authored 343e9ffbff9
1 1 | --- src/ssl_support.c.orig 2010-03-15 04:20:45.000000000 +1100 |
2 - | +++ src/ssl_support.c 2016-04-07 02:04:53.000000000 +1000 |
3 - | |
2 + | +++ src/ssl_support.c 2019-09-10 13:35:14.000000000 +1000 |
3 + | |
4 + | ssl_verify_cb(int ok, X509_STORE_CTX * ctx) |
5 + | { |
6 + | char buffer[256]; |
7 + | - X509 *peer_cert = ctx->cert; |
8 + | + X509 *peer_cert = X509_STORE_CTX_get0_cert(ctx); |
9 + | |
10 + | X509_NAME_oneline(X509_get_subject_name(peer_cert), buffer, |
11 + | sizeof(buffer)); |
12 + | |
13 + | if (ok) { |
14 + | debug(83, 5) ("SSL Certificate signature OK: %s\n", buffer); |
15 + | } else { |
16 + | - switch (ctx->error) { |
17 + | + switch (X509_STORE_CTX_get_error(ctx)) { |
18 + | case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: |
19 + | debug(83, 5) ("SSL Certficate error: CA not known: %s\n", buffer); |
20 + | break; |
21 + | |
22 + | break; |
23 + | default: |
24 + | debug(83, 1) ("SSL unknown certificate error %d in %s\n", |
25 + | - ctx->error, buffer); |
26 + | + X509_STORE_CTX_get_error(ctx), buffer); |
27 + | break; |
28 + | } |
29 + | } |
30 + | |
4 31 | ERR_clear_error(); |
5 32 | debug(83, 1) ("Initialising SSL.\n"); |
6 33 | switch (version) { |
7 34 | - case 2: |
8 35 | - debug(83, 5) ("Using SSLv2.\n"); |
9 36 | - method = SSLv2_server_method(); |
10 37 | - break; |
11 - | case 3: |
12 - | debug(83, 5) ("Using SSLv3.\n"); |
13 - | method = SSLv3_server_method(); |
14 - | |
38 + | - case 3: |
39 + | - debug(83, 5) ("Using SSLv3.\n"); |
40 + | - method = SSLv3_server_method(); |
41 + | - break; |
42 + | case 4: |
43 + | debug(83, 5) ("Using TLSv1.\n"); |
15 44 | method = TLSv1_server_method(); |
16 45 | break; |
17 46 | case 1: |
18 47 | + case 2: |
48 + | + case 3: |
19 49 | default: |
20 50 | debug(83, 5) ("Using SSLv2/SSLv3.\n"); |
21 51 | method = SSLv23_server_method(); |
22 - | |
52 + | |
23 53 | ERR_clear_error(); |
24 54 | debug(83, 1) ("Initialising SSL.\n"); |
25 55 | switch (version) { |
26 56 | - case 2: |
27 57 | - debug(83, 5) ("Using SSLv2.\n"); |
28 58 | - method = SSLv2_client_method(); |
29 59 | - break; |
30 - | case 3: |
31 - | debug(83, 5) ("Using SSLv3.\n"); |
32 - | method = SSLv3_client_method(); |
33 - | |
60 + | - case 3: |
61 + | - debug(83, 5) ("Using SSLv3.\n"); |
62 + | - method = SSLv3_client_method(); |
63 + | - break; |
64 + | case 4: |
65 + | debug(83, 5) ("Using TLSv1.\n"); |
34 66 | method = TLSv1_client_method(); |
35 67 | break; |
36 68 | case 1: |
37 69 | + case 2: |
70 + | + case 3: |
38 71 | default: |
39 72 | debug(83, 5) ("Using SSLv2/SSLv3.\n"); |
40 73 | method = SSLv23_client_method(); |