Skip to content

Commit

Permalink
Minor Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiksaligrama committed Oct 7, 2014
1 parent f132d22 commit 6fbc357
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
41 changes: 41 additions & 0 deletions MQTT.xcodeproj/project.xcworkspace/xcshareddata/MQTT.xccheckout
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>9E7DE5D4-230A-4674-BE14-DD3193DE14EC</string>
<key>IDESourceControlProjectName</key>
<string>MQTT</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>06C3787505A81EB329D5EA22872565C0993B20DA</key>
<string>https://github.com/karthiksaligrama/MQTT.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>MQTT.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>06C3787505A81EB329D5EA22872565C0993B20DA</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/karthiksaligrama/MQTT.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>06C3787505A81EB329D5EA22872565C0993B20DA</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>06C3787505A81EB329D5EA22872565C0993B20DA</string>
<key>IDESourceControlWCCName</key>
<string>MQTTFramework</string>
</dict>
</array>
</dict>
</plist>
2 changes: 2 additions & 0 deletions MQTT/MQTTClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#import <Foundation/Foundation.h>
#import "MQTTMessage.h"



typedef enum MQTTConnectionResponse:NSUInteger{
ConnectionAccepted,
ProtocolViolation,
Expand Down
7 changes: 6 additions & 1 deletion MQTT/MQTTClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ -(void)connectWithHost:(NSString *)hostName withPort:(int)port enableSSL:(bool)s
save_ssl_certificate_at_path(cpy,caFilePath);
free(cpy);

mosquitto_tls_set(mosq,caFilePath, NULL, NULL, NULL, NULL);
int success = mosquitto_tls_set(mosq,caFilePath, NULL, NULL, NULL, NULL);
if(success == MOSQ_ERR_SUCCESS){
NSLog(@"SSL Set successful");
}else{
NSLog(@"ssl error %d",success);
}
}

const char *cstrHost = [self.host cStringUsingEncoding:NSASCIIStringEncoding];
Expand Down
6 changes: 3 additions & 3 deletions MQTT/sslhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ int save_ssl_certificate_at_path(char dest_url[], const char *filename)

//Get the remote certificate into the X509 structure
cert = SSL_get_peer_certificate(ssl);

if (cert == NULL)//{
raise(SIGINT);

Expand Down Expand Up @@ -168,9 +169,8 @@ int create_socket(char url_str[], BIO *out) {
}


/* for testing
//for testing
int main()
{
return save_ssl_certificate_at_path("https://nextstep.tcs.com:443","/Users/kass/Desktop/filename.crt");
return save_ssl_certificate_at_path("ssl://test.mosquitto.org:8884","/Users/kass/Desktop/filename.crt");
}
*/

0 comments on commit 6fbc357

Please sign in to comment.