src/ssl_sock.c
static int bind_parse_verify(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
{
	if (!*args[cur_arg + 1]) {
		if (err)
			memprintf(err, "'%s' : missing verify method", args[cur_arg]);
		return ERR_ALERT | ERR_FATAL;
	}

	if (strcmp(args[cur_arg + 1], "none") == 0)
		conf->verify = SSL_VERIFY_NONE;
	else if (strcmp(args[cur_arg + 1], "optional") == 0)
		conf->verify = SSL_VERIFY_PEER;
	else if (strcmp(args[cur_arg + 1], "required") == 0)
		conf->verify = SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
	else {
		if (err)
			memprintf(err, "'%s' : unknown verify method '%s', only 'none', 'optional', and 'required' are supported\n",
			          args[cur_arg], args[cur_arg + 1]);
		return ERR_ALERT | ERR_FATAL;
	}

	return 0;
}
/* parse the "verify" bind keyword */
parse the "verify" bind keyword
parse the " verify " bind keyword
static int bind_parse_verify(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
{
	if (!*args[cur_arg + 1]) {
		if (err)
			memprintf(err, "'%s' : missing verify method", args[cur_arg]);
		return ERR_ALERT | ERR_FATAL;
	}
	if (strcmp(args[cur_arg + 1], "none") == 0)
		conf->verify = SSL_VERIFY_NONE;
	else if (strcmp(args[cur_arg + 1], "optional") == 0)
		conf->verify = SSL_VERIFY_PEER;
	else if (strcmp(args[cur_arg + 1], "required") == 0)
		conf->verify = SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
	else {
		if (err)
			memprintf(err, "'%s' : unknown verify method '%s', only 'none', 'optional', and 'required' are supported\n",
			          args[cur_arg], args[cur_arg + 1]);
		return ERR_ALERT | ERR_FATAL;
	}
	return 0;
}
static int bind_parse_verify ( char * * args , int cur_arg , struct proxy * px , struct bind_conf * conf , char * * err ) { if ( ! * args [ cur_arg + 1 ] ) { if ( err ) memprintf ( err , " " , args [ cur_arg ] ) ; return ERR_ALERT | ERR_FATAL ; } if ( strcmp ( args [ cur_arg + 1 ] , " " ) == 0 ) conf -> verify = SSL_VERIFY_NONE ; else if ( strcmp ( args [ cur_arg + 1 ] , " " ) == 0 ) conf -> verify = SSL_VERIFY_PEER ; else if ( strcmp ( args [ cur_arg + 1 ] , " " ) == 0 ) conf -> verify = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT ; else { if ( err ) memprintf ( err , " \n " , args [ cur_arg ] , args [ cur_arg + 1 ] ) ; return ERR_ALERT | ERR_FATAL ; } return 0 ; }
parse the "verify" bind keyword
parse the " verify " bind keyword