Fossil SCM
tls: move the checking for --https to before verify_options is called
Commit
60d1581ff00fc2688dcedcbdce70caabb576b10560f6a08ae61d08b00e10c16d
Parent
8dde27776839648…
1 file changed
+3
-1
+3
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -3067,10 +3067,11 @@ | ||
| 3067 | 3067 | const char *zFossilCmd =0; /* Name of "fossil" binary on remote system */ |
| 3068 | 3068 | #if FOSSIL_ENABLE_SSL |
| 3069 | 3069 | const char *zCertFile =0; /* Internal - TLS/SSL cert filename of the --tls-cert-file option */ |
| 3070 | 3070 | int zTls =0; /* Internal - 1 = use a TLS/SSL cert that has been previously loaded by ssl-config load-cert command or 0 if no TLS / SSL has been loaeded */ |
| 3071 | 3071 | #endif |
| 3072 | + const char *zHttps =0; /* Internal - set if if --https is present */ | |
| 3072 | 3073 | #if defined(_WIN32) |
| 3073 | 3074 | const char *zStopperFile; /* Name of file used to terminate server */ |
| 3074 | 3075 | zStopperFile = find_option("stopper", 0, 1); |
| 3075 | 3076 | #endif |
| 3076 | 3077 | |
| @@ -3148,10 +3149,11 @@ | ||
| 3148 | 3149 | #if !defined(_WIN32) |
| 3149 | 3150 | /* Disable the timeout during debugging */ |
| 3150 | 3151 | zTimeout = "100000000"; |
| 3151 | 3152 | #endif |
| 3152 | 3153 | } |
| 3154 | + zHttps = find_option("https",0,0); | |
| 3153 | 3155 | /* We should be done with options.. */ |
| 3154 | 3156 | verify_all_options(); |
| 3155 | 3157 | |
| 3156 | 3158 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 3157 | 3159 | if( isUiCmd && 3==g.argc && file_isdir(g.argv[2], ExtFILE)>0 ){ |
| @@ -3197,11 +3199,11 @@ | ||
| 3197 | 3199 | ** The database has only just been found and made available |
| 3198 | 3200 | */ |
| 3199 | 3201 | #if FOSSIL_ENABLE_SSL |
| 3200 | 3202 | init_ssl_decoder(zCertFile, zTls); |
| 3201 | 3203 | #endif |
| 3202 | - if( find_option("https",0,0)!=0 || g.httpUseSSL ){ | |
| 3204 | + if( zHttps !=0 || g.httpUseSSL ){ | |
| 3203 | 3205 | cgi_replace_parameter("HTTPS","on"); |
| 3204 | 3206 | } |
| 3205 | 3207 | if( g.httpUseSSL && (flags & HTTP_SERVER_SCGI)!=0 ){ |
| 3206 | 3208 | fossil_fatal("SCGI does not (yet) support TLS-encrypted connections"); |
| 3207 | 3209 | } |
| 3208 | 3210 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -3067,10 +3067,11 @@ | |
| 3067 | const char *zFossilCmd =0; /* Name of "fossil" binary on remote system */ |
| 3068 | #if FOSSIL_ENABLE_SSL |
| 3069 | const char *zCertFile =0; /* Internal - TLS/SSL cert filename of the --tls-cert-file option */ |
| 3070 | int zTls =0; /* Internal - 1 = use a TLS/SSL cert that has been previously loaded by ssl-config load-cert command or 0 if no TLS / SSL has been loaeded */ |
| 3071 | #endif |
| 3072 | #if defined(_WIN32) |
| 3073 | const char *zStopperFile; /* Name of file used to terminate server */ |
| 3074 | zStopperFile = find_option("stopper", 0, 1); |
| 3075 | #endif |
| 3076 | |
| @@ -3148,10 +3149,11 @@ | |
| 3148 | #if !defined(_WIN32) |
| 3149 | /* Disable the timeout during debugging */ |
| 3150 | zTimeout = "100000000"; |
| 3151 | #endif |
| 3152 | } |
| 3153 | /* We should be done with options.. */ |
| 3154 | verify_all_options(); |
| 3155 | |
| 3156 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 3157 | if( isUiCmd && 3==g.argc && file_isdir(g.argv[2], ExtFILE)>0 ){ |
| @@ -3197,11 +3199,11 @@ | |
| 3197 | ** The database has only just been found and made available |
| 3198 | */ |
| 3199 | #if FOSSIL_ENABLE_SSL |
| 3200 | init_ssl_decoder(zCertFile, zTls); |
| 3201 | #endif |
| 3202 | if( find_option("https",0,0)!=0 || g.httpUseSSL ){ |
| 3203 | cgi_replace_parameter("HTTPS","on"); |
| 3204 | } |
| 3205 | if( g.httpUseSSL && (flags & HTTP_SERVER_SCGI)!=0 ){ |
| 3206 | fossil_fatal("SCGI does not (yet) support TLS-encrypted connections"); |
| 3207 | } |
| 3208 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -3067,10 +3067,11 @@ | |
| 3067 | const char *zFossilCmd =0; /* Name of "fossil" binary on remote system */ |
| 3068 | #if FOSSIL_ENABLE_SSL |
| 3069 | const char *zCertFile =0; /* Internal - TLS/SSL cert filename of the --tls-cert-file option */ |
| 3070 | int zTls =0; /* Internal - 1 = use a TLS/SSL cert that has been previously loaded by ssl-config load-cert command or 0 if no TLS / SSL has been loaeded */ |
| 3071 | #endif |
| 3072 | const char *zHttps =0; /* Internal - set if if --https is present */ |
| 3073 | #if defined(_WIN32) |
| 3074 | const char *zStopperFile; /* Name of file used to terminate server */ |
| 3075 | zStopperFile = find_option("stopper", 0, 1); |
| 3076 | #endif |
| 3077 | |
| @@ -3148,10 +3149,11 @@ | |
| 3149 | #if !defined(_WIN32) |
| 3150 | /* Disable the timeout during debugging */ |
| 3151 | zTimeout = "100000000"; |
| 3152 | #endif |
| 3153 | } |
| 3154 | zHttps = find_option("https",0,0); |
| 3155 | /* We should be done with options.. */ |
| 3156 | verify_all_options(); |
| 3157 | |
| 3158 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 3159 | if( isUiCmd && 3==g.argc && file_isdir(g.argv[2], ExtFILE)>0 ){ |
| @@ -3197,11 +3199,11 @@ | |
| 3199 | ** The database has only just been found and made available |
| 3200 | */ |
| 3201 | #if FOSSIL_ENABLE_SSL |
| 3202 | init_ssl_decoder(zCertFile, zTls); |
| 3203 | #endif |
| 3204 | if( zHttps !=0 || g.httpUseSSL ){ |
| 3205 | cgi_replace_parameter("HTTPS","on"); |
| 3206 | } |
| 3207 | if( g.httpUseSSL && (flags & HTTP_SERVER_SCGI)!=0 ){ |
| 3208 | fossil_fatal("SCGI does not (yet) support TLS-encrypted connections"); |
| 3209 | } |
| 3210 |