MCPcopy Create free account
hub / github.com/apache/cloudberry / sslVerifyProtocolVersion

Function sslVerifyProtocolVersion

src/interfaces/libpq/fe-connect.c:7404–7422  ·  view source on GitHub ↗

* Check if the SSL protocol value given in input is valid or not. * This is used as a sanity check routine for the connection parameters * ssl_min_protocol_version and ssl_max_protocol_version. */

Source from the content-addressed store, hash-verified

7402 * ssl_min_protocol_version and ssl_max_protocol_version.
7403 */
7404static bool
7405sslVerifyProtocolVersion(const char *version)
7406{
7407 /*
7408 * An empty string and a NULL value are considered valid as it is
7409 * equivalent to ignoring the parameter.
7410 */
7411 if (!version || strlen(version) == 0)
7412 return true;
7413
7414 if (pg_strcasecmp(version, "TLSv1") == 0 ||
7415 pg_strcasecmp(version, "TLSv1.1") == 0 ||
7416 pg_strcasecmp(version, "TLSv1.2") == 0 ||
7417 pg_strcasecmp(version, "TLSv1.3") == 0)
7418 return true;
7419
7420 /* anything else is wrong */
7421 return false;
7422}
7423
7424
7425/*

Callers 2

connectOptions2Function · 0.85
sslVerifyProtocolRangeFunction · 0.85

Calls 1

pg_strcasecmpFunction · 0.85

Tested by

no test coverage detected