@@ -68,6 +68,7 @@ static size_t arg_chunk_size_max = 0;
6868static uint64_t arg_rate_limit_bps = UINT64_MAX ;
6969static unsigned arg_max_active_chunks = 0 ;
7070static unsigned arg_max_host_connections = 0 ;
71+ static bool arg_ssl_trust_peer = false;
7172static uint64_t arg_with = 0 ;
7273static uint64_t arg_without = 0 ;
7374static uid_t arg_uid_shift = 0 , arg_uid_range = 0x10000U ;
@@ -114,6 +115,7 @@ static void help(void) {
114115 " --max-host-connections=MAX\n"
115116 " Maximum number of connections to a single host for\n"
116117 " remote communication\n"
118+ " --ssl-trust-peer Trust the peer's SSL certificate\n"
117119 " --exclude-nodump=no Don't exclude files with chattr(1)'s +d 'nodump'\n"
118120 " flag when creating archive\n"
119121 " --exclude-submounts=yes Exclude submounts when creating archive\n"
@@ -337,6 +339,7 @@ static int parse_argv(int argc, char *argv[]) {
337339 ARG_RATE_LIMIT_BPS ,
338340 ARG_MAX_ACTIVE_CHUNKS ,
339341 ARG_MAX_HOST_CONNECTIONS ,
342+ ARG_SSL_TRUST_PEER ,
340343 ARG_WITH ,
341344 ARG_WITHOUT ,
342345 ARG_WHAT ,
@@ -373,6 +376,7 @@ static int parse_argv(int argc, char *argv[]) {
373376 { "rate-limit-bps" , required_argument , NULL , ARG_RATE_LIMIT_BPS },
374377 { "max-active-chunks" , required_argument , NULL , ARG_MAX_ACTIVE_CHUNKS },
375378 { "max-host-connections" , required_argument , NULL , ARG_MAX_HOST_CONNECTIONS },
379+ { "ssl-trust-peer" , no_argument , NULL , ARG_SSL_TRUST_PEER },
376380 { "with" , required_argument , NULL , ARG_WITH },
377381 { "without" , required_argument , NULL , ARG_WITHOUT },
378382 { "what" , required_argument , NULL , ARG_WHAT },
@@ -502,6 +506,10 @@ static int parse_argv(int argc, char *argv[]) {
502506 }
503507 break ;
504508
509+ case ARG_SSL_TRUST_PEER :
510+ arg_ssl_trust_peer = true;
511+ break ;
512+
505513 case ARG_WITH : {
506514 uint64_t u ;
507515
@@ -1369,6 +1377,12 @@ static int verb_make(int argc, char *argv[]) {
13691377 return log_error_errno (r , "Failed to set max host connections: %m" );
13701378 }
13711379
1380+ if (arg_ssl_trust_peer ) {
1381+ r = ca_sync_set_ssl_trust_peer (s , arg_ssl_trust_peer );
1382+ if (r < 0 )
1383+ return log_error_errno (r , "Failed to set SSL trust peer: %m" );
1384+ }
1385+
13721386 r = ca_sync_set_base_fd (s , input_fd );
13731387 if (r < 0 )
13741388 return log_error_errno (r , "Failed to set sync base: %m" );
@@ -1686,6 +1700,12 @@ static int verb_extract(int argc, char *argv[]) {
16861700 return log_error_errno (r , "Failed to set max host connections: %m" );
16871701 }
16881702
1703+ if (arg_ssl_trust_peer ) {
1704+ r = ca_sync_set_ssl_trust_peer (s , arg_ssl_trust_peer );
1705+ if (r < 0 )
1706+ return log_error_errno (r , "Failed to set SSL trust peer: %m" );
1707+ }
1708+
16891709 if (seek_path ) {
16901710 if (output_fd >= 0 )
16911711 r = ca_sync_set_boundary_fd (s , output_fd );
@@ -2859,6 +2879,12 @@ static int verb_mount(int argc, char *argv[]) {
28592879 return log_error_errno (r , "Failed to set max host connections: %m" );
28602880 }
28612881
2882+ if (arg_ssl_trust_peer ) {
2883+ r = ca_sync_set_ssl_trust_peer (s , arg_ssl_trust_peer );
2884+ if (r < 0 )
2885+ return log_error_errno (r , "Failed to set SSL trust peer: %m" );
2886+ }
2887+
28622888 if (operation == MOUNT_ARCHIVE ) {
28632889 if (input_fd >= 0 )
28642890 r = ca_sync_set_archive_fd (s , input_fd );
@@ -2997,6 +3023,12 @@ static int verb_mkdev(int argc, char *argv[]) {
29973023 return log_error_errno (r , "Failed to set max host connections: %m" );
29983024 }
29993025
3026+ if (arg_ssl_trust_peer ) {
3027+ r = ca_sync_set_ssl_trust_peer (s , arg_ssl_trust_peer );
3028+ if (r < 0 )
3029+ return log_error_errno (r , "Failed to set SSL trust peer: %m" );
3030+ }
3031+
30003032 if (operation == MKDEV_BLOB ) {
30013033 if (input_fd >= 0 )
30023034 r = ca_sync_set_archive_fd (s , input_fd );
@@ -3576,6 +3608,12 @@ static int verb_pull(int argc, char *argv[]) {
35763608 return log_error_errno (r , "Failed to set max host connections: %m" );
35773609 }
35783610
3611+ if (arg_ssl_trust_peer ) {
3612+ r = ca_remote_set_ssl_trust_peer (rr , arg_ssl_trust_peer );
3613+ if (r < 0 )
3614+ return log_error_errno (r , "Failed to set SSL trust peer: %m" );
3615+ }
3616+
35793617 r = ca_remote_set_io_fds (rr , STDIN_FILENO , STDOUT_FILENO );
35803618 if (r < 0 )
35813619 return log_error_errno (r , "Failed to set I/O file descriptors: %m" );
@@ -3747,6 +3785,12 @@ static int verb_push(int argc, char *argv[]) {
37473785 return log_error_errno (r , "Failed to set max host connections: %m" );
37483786 }
37493787
3788+ if (arg_ssl_trust_peer ) {
3789+ r = ca_remote_set_ssl_trust_peer (rr , arg_ssl_trust_peer );
3790+ if (r < 0 )
3791+ return log_error_errno (r , "Failed to set SSL trust peer: %m" );
3792+ }
3793+
37503794 r = ca_remote_set_io_fds (rr , STDIN_FILENO , STDOUT_FILENO );
37513795 if (r < 0 )
37523796 log_error_errno (r , "Failed to set I/O file descriptors: %m" );
0 commit comments