Skip to content

Commit

Permalink
Use local encryption setting as default
Browse files Browse the repository at this point in the history
If the client is not shared (advertised via Bonjour) the server does not find the encryption setting of the client and assumes always true.
This change will adjust this behaviour and defaults to the local setting on the server.
  • Loading branch information
FliegenKLATSCH authored Jun 6, 2021
1 parent 73a8167 commit f5c6406
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions TPConnectionsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,9 @@ - (BOOL)tcpSecureSocketShouldEnableEncryption:(TPTCPSecureSocket*)tcpSocket
NSString * remoteAddress = [tcpSocket remoteAddress];
TPRemoteHost * remoteHost = [[TPHostsManager defaultManager] hostWithAddress:remoteAddress];
if(remoteHost == nil) {
NSLog(@"could not determine which host has IP %@, will use encrypted connection by default", remoteAddress);
return YES; // encrypted by default
BOOL encryptionActive = [[TPPreferencesManager sharedPreferencesManager] boolForPref:ENABLED_ENCRYPTION];
NSLog(@"could not determine which host has IP %@, will%s use encryption as it is configured so locally", remoteAddress, encryptionActive ? "" : " NOT");
return encryptionActive; // encrypted by default, if encryption is enabled locally
}
else {
return [[TPLocalHost localHost] pairWithHost:remoteHost hasCapability:TPHostEncryptionCapability];
Expand Down

0 comments on commit f5c6406

Please sign in to comment.