Skip to content

Commit

Permalink
Remove http support, no longer supported by salesforce.com
Browse files Browse the repository at this point in the history
  • Loading branch information
rmottola committed Aug 28, 2020
1 parent c31d8a1 commit cdad419
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 24 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2020-08-28 Riccardo Mottola <rm@gnu.org>

* DBSoap.m
* DBSoap.h
Remove http support, no longer supported by salesforce.com

2020-05-29 Riccardo Mottola <rm@gnu.org>

* DBSoap.m
Expand Down
4 changes: 2 additions & 2 deletions DBSoap.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Project: DataBasin
Copyright (C) 2008-2019 Free Software Foundation
Copyright (C) 2008-2020 Free Software Foundation
Author: Riccardo Mottola
Expand Down Expand Up @@ -101,7 +101,7 @@
+ (NSURL *)loginURLTest;
+ (GWSService *)gwserviceForDBSoap;

- (void)login :(NSURL *)url :(NSString *)userName :(NSString *)password :(BOOL)useHttps;
- (void)login :(NSURL *)url :(NSString *)userName :(NSString *)password;
- (void)setLogger: (id<DBLoggerProtocol>)l;
- (id<DBLoggerProtocol>)logger;
- (unsigned)upBatchSize;
Expand Down
26 changes: 4 additions & 22 deletions DBSoap.m
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ - (void)setMaxSOQLLength:(unsigned)size
maxSOQLLength = MAX_SOQL_LENGTH;
}

- (void)_login :(NSURL *)url :(NSString *)userName :(NSString *)password :(BOOL)useHttps
- (void)_login :(NSURL *)url :(NSString *)userName :(NSString *)password
{
NSUserDefaults *defs;
NSMutableArray *orderArray;
Expand All @@ -360,14 +360,6 @@ - (void)_login :(NSURL *)url :(NSString *)userName :(NSString *)password :(BOOL)
/* init our service */
service = [[DBSoap gwserviceForDBSoap] retain];

if (!useHttps && [[url scheme] isEqualTo:@"https"])
{
if (!useHttps)
url = [[NSURL alloc] initWithScheme:@"http" host:[url host] path:[url path]];
else
url = [[NSURL alloc] initWithScheme:@"https" host:[url host] path:[url path]];
[url autorelease];
}
[service setURL:url];

//[service setDebug:YES];
Expand Down Expand Up @@ -443,15 +435,6 @@ - (void)_login :(NSURL *)url :(NSString *)userName :(NSString *)password :(BOOL)
[userInfo setValue:[userInfoResult objectForKey:@"userFullName"] forKey:@"userFullName"];
[userInfo setValue:[userInfoResult objectForKey:@"userName"] forKey:@"userName"];


/* since Salesforce seems to be stubborn and returns an https connection
even if we initiate a non-secure one, we force it to http */
if ([[gottenURL scheme] isEqualToString:@"https"] && !useHttps)
{
[logger log: LogInformative: @"[DBSoap Login]: preferences set to http, forcing....\n"];
gottenURL = [[NSURL alloc] initWithScheme:@"http" host:[gottenURL host] path:[gottenURL path]];
[gottenURL autorelease];
}
[self setServerURL:gottenURL];

if (sessionId == nil)
Expand Down Expand Up @@ -1293,17 +1276,16 @@ - (void)dealloc

/**<p>executes login</p>
<p><i>url</i> specifies the URL of the endpoint</p>
<p><i>useHttps</i> specifies if secure connecton has to be used or not. If not, http is attempted and then enforced.
The Salesforce.com instance must be configured to accept non-secure connections.</p>
<p>salesforce.com removed HTTP support since Spring '20, so HTTPS is mandatory</p>
*/
- (void)login :(NSURL *)url :(NSString *)userName :(NSString *)password :(BOOL)useHttps
- (void)login :(NSURL *)url :(NSString *)userName :(NSString *)password
{
[lockBusy lock];
busyCount++;
[lockBusy unlock];

NS_DURING
[self _login :url :userName :password :useHttps];
[self _login :url :userName :password];
NS_HANDLER
{
[lockBusy lock];
Expand Down

0 comments on commit cdad419

Please sign in to comment.