@@ -306,8 +306,8 @@ cfg_replication! {
306
306
307
307
/// Set the encryption context if the database is encrypted in remote server.
308
308
#[ cfg( feature = "sync" ) ]
309
- pub fn remote_encryption( mut self , encryption_context: Option < EncryptionContext > ) -> Builder <RemoteReplica > {
310
- self . inner. remote_encryption = encryption_context;
309
+ pub fn remote_encryption( mut self , encryption_context: EncryptionContext ) -> Builder <RemoteReplica > {
310
+ self . inner. remote_encryption = Some ( encryption_context) ;
311
311
self
312
312
}
313
313
@@ -432,11 +432,14 @@ cfg_replication! {
432
432
433
433
if res. status( ) . is_success( ) {
434
434
tracing:: trace!( "Using sync protocol v2 for {}" , url) ;
435
- let builder = Builder :: new_synced_database( path, url, auth_token)
435
+ let mut builder = Builder :: new_synced_database( path, url, auth_token)
436
436
. connector( connector)
437
437
. remote_writes( true )
438
- . read_your_writes( read_your_writes)
439
- . remote_encryption( remote_encryption) ;
438
+ . read_your_writes( read_your_writes) ;
439
+
440
+ if let Some ( encryption) = remote_encryption {
441
+ builder = builder. remote_encryption( encryption) ;
442
+ }
440
443
441
444
let builder = if let Some ( sync_interval) = sync_interval {
442
445
builder. sync_interval( sync_interval)
@@ -621,8 +624,8 @@ cfg_sync! {
621
624
}
622
625
623
626
/// Set the encryption context if the database is encrypted in remote server.
624
- pub fn remote_encryption( mut self , encryption_context: Option < EncryptionContext > ) -> Builder <SyncedDatabase > {
625
- self . inner. remote_encryption = encryption_context;
627
+ pub fn remote_encryption( mut self , encryption_context: EncryptionContext ) -> Builder <SyncedDatabase > {
628
+ self . inner. remote_encryption = Some ( encryption_context) ;
626
629
self
627
630
}
628
631
@@ -789,8 +792,8 @@ cfg_remote! {
789
792
}
790
793
791
794
/// Set the encryption context if the database is encrypted in remote server.
792
- pub fn remote_encryption( mut self , encryption_context: Option < EncryptionContext > ) -> Builder <Remote > {
793
- self . inner. remote_encryption = encryption_context;
795
+ pub fn remote_encryption( mut self , encryption_context: EncryptionContext ) -> Builder <Remote > {
796
+ self . inner. remote_encryption = Some ( encryption_context) ;
794
797
self
795
798
}
796
799
0 commit comments