Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eclipse
paho.mqtt.c
Commits
2ac34c25
Commit
2ac34c25
authored
May 01, 2017
by
Ian Craggs
Committed by
GitHub
May 01, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #260 from fpagliughi/check-non-ssl2
Proposal for non-SSL version error. Issue #251
parents
e30861eb
622e740c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
2 deletions
+21
-2
MQTTAsync.c
src/MQTTAsync.c
+6
-0
MQTTAsync.h
src/MQTTAsync.h
+4
-0
MQTTClient.c
src/MQTTClient.c
+7
-2
MQTTClient.h
src/MQTTClient.h
+4
-0
No files found.
src/MQTTAsync.c
View file @
2ac34c25
...
@@ -2298,6 +2298,12 @@ int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options)
...
@@ -2298,6 +2298,12 @@ int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options)
m
->
c
->
sslopts
->
enabledCipherSuites
=
MQTTStrdup
(
options
->
ssl
->
enabledCipherSuites
);
m
->
c
->
sslopts
->
enabledCipherSuites
=
MQTTStrdup
(
options
->
ssl
->
enabledCipherSuites
);
m
->
c
->
sslopts
->
enableServerCertAuth
=
options
->
ssl
->
enableServerCertAuth
;
m
->
c
->
sslopts
->
enableServerCertAuth
=
options
->
ssl
->
enableServerCertAuth
;
}
}
#else
if
(
options
->
struct_version
!=
0
&&
options
->
ssl
)
{
rc
=
MQTTASYNC_SSL_NOT_SUPPORTED
;
goto
exit
;
}
#endif
#endif
m
->
c
->
username
=
options
->
username
;
m
->
c
->
username
=
options
->
username
;
...
...
src/MQTTAsync.h
View file @
2ac34c25
...
@@ -162,6 +162,10 @@
...
@@ -162,6 +162,10 @@
* Return code: no more messages can be buffered
* Return code: no more messages can be buffered
*/
*/
#define MQTTASYNC_MAX_BUFFERED_MESSAGES -12
#define MQTTASYNC_MAX_BUFFERED_MESSAGES -12
/**
* Return code: Attempting SSL connection using non-SSL version of library
*/
#define MQTTASYNC_SSL_NOT_SUPPORTED -13
/**
/**
* Default MQTT version to connect with. Use 3.1.1 then fall back to 3.1
* Default MQTT version to connect with. Use 3.1.1 then fall back to 3.1
...
...
src/MQTTClient.c
View file @
2ac34c25
...
@@ -61,6 +61,8 @@
...
@@ -61,6 +61,8 @@
#if defined(OPENSSL)
#if defined(OPENSSL)
#include <openssl/ssl.h>
#include <openssl/ssl.h>
#else
#define URI_SSL "ssl://"
#endif
#endif
#define URI_TCP "tcp://"
#define URI_TCP "tcp://"
...
@@ -323,13 +325,16 @@ int MQTTClient_create(MQTTClient* handle, const char* serverURI, const char* cli
...
@@ -323,13 +325,16 @@ int MQTTClient_create(MQTTClient* handle, const char* serverURI, const char* cli
memset
(
m
,
'\0'
,
sizeof
(
MQTTClients
));
memset
(
m
,
'\0'
,
sizeof
(
MQTTClients
));
if
(
strncmp
(
URI_TCP
,
serverURI
,
strlen
(
URI_TCP
))
==
0
)
if
(
strncmp
(
URI_TCP
,
serverURI
,
strlen
(
URI_TCP
))
==
0
)
serverURI
+=
strlen
(
URI_TCP
);
serverURI
+=
strlen
(
URI_TCP
);
#if defined(OPENSSL)
else
if
(
strncmp
(
URI_SSL
,
serverURI
,
strlen
(
URI_SSL
))
==
0
)
else
if
(
strncmp
(
URI_SSL
,
serverURI
,
strlen
(
URI_SSL
))
==
0
)
{
{
#if defined(OPENSSL)
serverURI
+=
strlen
(
URI_SSL
);
serverURI
+=
strlen
(
URI_SSL
);
m
->
ssl
=
1
;
m
->
ssl
=
1
;
}
#else
rc
=
MQTTCLIENT_SSL_NOT_SUPPORTED
;
goto
exit
;
#endif
#endif
}
m
->
serverURI
=
MQTTStrdup
(
serverURI
);
m
->
serverURI
=
MQTTStrdup
(
serverURI
);
ListAppend
(
handles
,
m
,
sizeof
(
MQTTClients
));
ListAppend
(
handles
,
m
,
sizeof
(
MQTTClients
));
...
...
src/MQTTClient.h
View file @
2ac34c25
...
@@ -167,6 +167,10 @@
...
@@ -167,6 +167,10 @@
* Return code: A QoS value that falls outside of the acceptable range (0,1,2)
* Return code: A QoS value that falls outside of the acceptable range (0,1,2)
*/
*/
#define MQTTCLIENT_BAD_QOS -9
#define MQTTCLIENT_BAD_QOS -9
/**
* Return code: Attempting SSL connection using non-SSL version of library
*/
#define MQTTCLIENT_SSL_NOT_SUPPORTED -10
/**
/**
* Default MQTT version to connect with. Use 3.1.1 then fall back to 3.1
* Default MQTT version to connect with. Use 3.1.1 then fall back to 3.1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment