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
aeb1724a
Commit
aeb1724a
authored
Apr 07, 2017
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for issues #160 and #155
parent
38d04272
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
SSLSocket.c
src/SSLSocket.c
+5
-5
No files found.
src/SSLSocket.c
View file @
aeb1724a
...
...
@@ -17,6 +17,7 @@
* Ian Craggs - fix for bug #453883
* Ian Craggs - fix for bug #480363, issue 13
* Ian Craggs - SNI support
* Ian Craggs - fix for issues #155, #160
*******************************************************************************/
/**
...
...
@@ -501,8 +502,6 @@ int SSLSocket_createContext(networkHandles* net, MQTTClient_SSLOptions* opts)
if
(
opts
->
keyStore
)
{
int
rc1
=
0
;
if
((
rc
=
SSL_CTX_use_certificate_chain_file
(
net
->
ctx
,
opts
->
keyStore
))
!=
1
)
{
SSLSocket_error
(
"SSL_CTX_use_certificate_chain_file"
,
NULL
,
net
->
socket
,
rc
);
...
...
@@ -516,13 +515,13 @@ int SSLSocket_createContext(networkHandles* net, MQTTClient_SSLOptions* opts)
{
SSL_CTX_set_default_passwd_cb
(
net
->
ctx
,
pem_passwd_cb
);
SSL_CTX_set_default_passwd_cb_userdata
(
net
->
ctx
,
(
void
*
)
opts
->
privateKeyPassword
);
}
}
/* support for ASN.1 == DER format? DER can contain only one certificate? */
rc
1
=
SSL_CTX_use_PrivateKey_file
(
net
->
ctx
,
opts
->
privateKey
,
SSL_FILETYPE_PEM
);
rc
=
SSL_CTX_use_PrivateKey_file
(
net
->
ctx
,
opts
->
privateKey
,
SSL_FILETYPE_PEM
);
if
(
opts
->
privateKey
==
opts
->
keyStore
)
opts
->
privateKey
=
NULL
;
if
(
rc
1
!=
1
)
if
(
rc
!=
1
)
{
SSLSocket_error
(
"SSL_CTX_use_PrivateKey_file"
,
NULL
,
net
->
socket
,
rc
);
goto
free_ctx
;
...
...
@@ -576,6 +575,7 @@ int SSLSocket_setSocketForSSL(networkHandles* net, MQTTClient_SSLOptions* opts,
if
(
net
->
ctx
!=
NULL
||
(
rc
=
SSLSocket_createContext
(
net
,
opts
))
==
1
)
{
int
i
;
printf
(
"%p %d
\n
"
,
net
->
ctx
,
rc
);
SSL_CTX_set_info_callback
(
net
->
ctx
,
SSL_CTX_info_callback
);
SSL_CTX_set_msg_callback
(
net
->
ctx
,
SSL_CTX_msg_callback
);
if
(
opts
->
enableServerCertAuth
)
...
...
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