mirror of
https://github.com/yrutschle/sslh.git
synced 2025-06-06 18:33:24 +03:00
turn ssl setting from command line to tls (ssl no longer exists)
This commit is contained in:
parent
2ee0088c5f
commit
aa77922ffd
1
probe.c
1
probe.c
@ -52,7 +52,6 @@ static struct proto builtins[] = {
|
|||||||
{ "tinc", NULL, NULL, 1, 0, 1, is_tinc_protocol },
|
{ "tinc", NULL, NULL, 1, 0, 1, is_tinc_protocol },
|
||||||
{ "xmpp", NULL, NULL, 1, 0, 0, is_xmpp_protocol },
|
{ "xmpp", NULL, NULL, 1, 0, 0, is_xmpp_protocol },
|
||||||
{ "http", NULL, NULL, 1, 0, 0, is_http_protocol },
|
{ "http", NULL, NULL, 1, 0, 0, is_http_protocol },
|
||||||
{ "ssl", NULL, NULL, 1, 0, 0, is_tls_protocol },
|
|
||||||
{ "tls", NULL, NULL, 1, 0, 0, is_tls_protocol },
|
{ "tls", NULL, NULL, 1, 0, 0, is_tls_protocol },
|
||||||
{ "adb", NULL, NULL, 1, 0, 0, is_adb_protocol },
|
{ "adb", NULL, NULL, 1, 0, 0, is_adb_protocol },
|
||||||
{ "socks5", NULL, NULL, 1, 0, 0, is_socks5_protocol },
|
{ "socks5", NULL, NULL, 1, 0, 0, is_socks5_protocol },
|
||||||
|
23
sslh-main.c
23
sslh-main.c
@ -147,11 +147,28 @@ static void printsettings(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* To removed in v1.21 */
|
||||||
|
const char* ssl_err_msg = "Usage of 'ssl' setting is deprecated and will be removed in v1.21. Please use 'tls' instead\n";
|
||||||
void ssl_to_tls(char* setting)
|
void ssl_to_tls(char* setting)
|
||||||
{
|
{
|
||||||
if (!strcmp(setting, "ssl")) {
|
if (!strcmp(setting, "ssl")) {
|
||||||
strcpy(setting, "tls"); /* legacy configuration */
|
strcpy(setting, "tls"); /* legacy configuration */
|
||||||
log_message(LOG_INFO, "Usage of 'ssl' setting is deprecated and will be removed in v1.21. Please use 'tls' instead\n");
|
log_message(LOG_INFO, ssl_err_msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Turn 'ssl' command line option to 'tls'. To removed in v1.21 */
|
||||||
|
void cmd_ssl_to_tls(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < argc; i++) {
|
||||||
|
if (!strcmp(argv[i], "--ssl")) {
|
||||||
|
strcpy(argv[i], "--tls");
|
||||||
|
/* foreground option not parsed yet, syslog not open, just print on
|
||||||
|
* stderr and hope for the best */
|
||||||
|
fprintf(stderr, ssl_err_msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,8 +351,10 @@ static int config_protocols(config_t *config, struct proto **prots)
|
|||||||
config_setting_lookup_string(prot, "host", &hostname) &&
|
config_setting_lookup_string(prot, "host", &hostname) &&
|
||||||
config_setting_lookup_string(prot, "port", &port)
|
config_setting_lookup_string(prot, "port", &port)
|
||||||
)) {
|
)) {
|
||||||
|
/* To removed in v1.21 */
|
||||||
name = strdup(cfg_name);
|
name = strdup(cfg_name);
|
||||||
ssl_to_tls(name);
|
ssl_to_tls(name);
|
||||||
|
/* /remove */
|
||||||
p->description = name;
|
p->description = name;
|
||||||
config_setting_lookup_string(prot, "service", &(p->service));
|
config_setting_lookup_string(prot, "service", &(p->service));
|
||||||
config_setting_lookup_bool(prot, "keepalive", &p->keepalive);
|
config_setting_lookup_bool(prot, "keepalive", &p->keepalive);
|
||||||
@ -485,6 +504,8 @@ static void cmdline_config(int argc, char* argv[], struct proto** prots)
|
|||||||
char *config_filename;
|
char *config_filename;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
cmd_ssl_to_tls(argc, argv); /* To remove in v1.21 */
|
||||||
|
|
||||||
make_alloptions();
|
make_alloptions();
|
||||||
|
|
||||||
#ifdef LIBCONFIG
|
#ifdef LIBCONFIG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user