| 622 | |
| 623 | #ifdef HAS_OPENSSL |
| 624 | static void set_ssl_version(SSL_CTX* ctx, int min_ver, int max_ver) |
| 625 | { |
| 626 | if (min_ver > max_ver) { |
| 627 | return; |
| 628 | } |
| 629 | |
| 630 | if (min_ver == tls_ver_1_2) { |
| 631 | __ssl_ctx_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, TLS1_2_VERSION, NULL); |
| 632 | } else if (min_ver == tls_ver_1_3) { |
| 633 | __ssl_ctx_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, TLS1_3_VERSION, NULL); |
| 634 | } |
| 635 | |
| 636 | if (max_ver == tls_ver_1_2) { |
| 637 | __ssl_ctx_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, TLS1_2_VERSION, NULL); |
| 638 | } else if (max_ver == tls_ver_1_3) { |
| 639 | __ssl_ctx_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, TLS1_3_VERSION, NULL); |
| 640 | } |
| 641 | } |
| 642 | #endif |
| 643 | |
| 644 | bool openssl_conf::set_version(int ver_min, int ver_max) { |
no outgoing calls
no test coverage detected
searching dependent graphs…