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

	if ((*args[cur_arg + 1] != '/' ) && global.crt_base) {
		if ((strlen(global.crt_base) + 1 + strlen(args[cur_arg + 1]) + 1) > PATH_MAX) {
			memprintf(err, "'%s' : path too long", args[cur_arg]);
			return ERR_ALERT | ERR_FATAL;
		}
		sprintf(path, "%s/%s",  global.crt_base, args[cur_arg + 1]);
		if (ssl_sock_load_cert(path, conf, px, err) > 0)
			return ERR_ALERT | ERR_FATAL;

		return 0;
	}

	if (ssl_sock_load_cert(args[cur_arg + 1], conf, px, err) > 0)
		return ERR_ALERT | ERR_FATAL;

	return 0;
}
/* parse the "crt" bind keyword */
parse the "crt" bind keyword
parse the " crt " bind keyword
static int bind_parse_crt(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
{
	char path[PATH_MAX];
	if (!*args[cur_arg + 1]) {
		memprintf(err, "'%s' : missing certificate location", args[cur_arg]);
		return ERR_ALERT | ERR_FATAL;
	}
	if ((*args[cur_arg + 1] != '/' ) && global.crt_base) {
		if ((strlen(global.crt_base) + 1 + strlen(args[cur_arg + 1]) + 1) > PATH_MAX) {
			memprintf(err, "'%s' : path too long", args[cur_arg]);
			return ERR_ALERT | ERR_FATAL;
		}
		sprintf(path, "%s/%s",  global.crt_base, args[cur_arg + 1]);
		if (ssl_sock_load_cert(path, conf, px, err) > 0)
			return ERR_ALERT | ERR_FATAL;
		return 0;
	}
	if (ssl_sock_load_cert(args[cur_arg + 1], conf, px, err) > 0)
		return ERR_ALERT | ERR_FATAL;
	return 0;
}
static int bind_parse_crt ( char * * args , int cur_arg , struct proxy * px , struct bind_conf * conf , char * * err ) { char path [ PATH_MAX ] ; if ( ! * args [ cur_arg + 1 ] ) { memprintf ( err , " " , args [ cur_arg ] ) ; return ERR_ALERT | ERR_FATAL ; } if ( ( * args [ cur_arg + 1 ] != ' ' ) && global . crt_base ) { if ( ( strlen ( global . crt_base ) + 1 + strlen ( args [ cur_arg + 1 ] ) + 1 ) > PATH_MAX ) { memprintf ( err , " " , args [ cur_arg ] ) ; return ERR_ALERT | ERR_FATAL ; } sprintf ( path , " " , global . crt_base , args [ cur_arg + 1 ] ) ; if ( ssl_sock_load_cert ( path , conf , px , err ) > 0 ) return ERR_ALERT | ERR_FATAL ; return 0 ; } if ( ssl_sock_load_cert ( args [ cur_arg + 1 ] , conf , px , err ) > 0 ) return ERR_ALERT | ERR_FATAL ; return 0 ; }
parse the "crt" bind keyword
parse the " crt " bind keyword