added -insecure_tls

This commit is contained in:
Fufu Fang 2019-10-28 00:50:28 +00:00
parent ea29af0e89
commit e9c8689f8d
No known key found for this signature in database
GPG Key ID: 0F6BB5EF6F8BB729
4 changed files with 13 additions and 0 deletions

View File

@ -169,6 +169,9 @@ static CURL *Link_to_curl(Link *link)
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 15);
curl_easy_setopt(curl, CURLOPT_SHARE, CURL_SHARE);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_memory_callback);
if (CONFIG.insecure_tls) {
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
}
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

View File

@ -154,6 +154,7 @@ parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc)
{"sonic-id3", no_argument, NULL, 'L'}, /* 17 */
{"no-range-check", no_argument, NULL, 'L'}, /* 18 */
{"sonic-insecure", no_argument, NULL, 'L'}, /* 19 */
{"insecure-tls", no_argument, NULL, 'L'}, /* 20 */
{0, 0, 0, 0}
};
while ((c =
@ -236,6 +237,9 @@ parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc)
case 19:
CONFIG.sonic_insecure = 1;
break;
case 20:
CONFIG.insecure_tls = 1;
break;
default:
fprintf(stderr, "see httpdirfs -h for usage\n");
return 1;
@ -310,6 +314,8 @@ HTTPDirFS options:\n\
--user-agent Set user agent string (default: \"HTTPDirFS\")\n\
--no-range-check Disable the build-in check for the server's support\n\
for HTTP range requests\n\
--insecure_tls Disable licurl TLS certificate verification by\n\
setting CURLOPT_SSL_VERIFYHOST to 0\n\
\n\
For mounting a Airsonic / Subsonic server:\n\
--sonic-username The username for your Airsonic / Subsonic server\n\

View File

@ -74,6 +74,8 @@ void Config_init(void)
CONFIG.no_range_check = 0;
CONFIG.insecure_tls = 0;
/*--------------- Cache related ---------------*/
CONFIG.cache_enabled = 0;

View File

@ -55,6 +55,8 @@ typedef struct {
int http_wait_sec;
/** \brief Disable check for the server's support of HTTP range request */
int no_range_check;
/** \brief Disable TLS certificate verification */
int insecure_tls;
/** \brief Whether cache mode is enabled */
int cache_enabled;