Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libwebsockets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Fork
libwebsockets
Commits
40d37e21
Commit
40d37e21
authored
8 years ago
by
Namowen
Committed by
Andy Green
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
client: fix X509_V_ERR_CERT_HAS_EXPIRED
parent
4241af99
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private-libwebsockets.h
+1
-1
1 addition, 1 deletion
lib/private-libwebsockets.h
lib/ssl-client.c
+15
-1
15 additions, 1 deletion
lib/ssl-client.c
with
16 additions
and
2 deletions
lib/private-libwebsockets.h
+
1
−
1
View file @
40d37e21
...
...
@@ -1490,7 +1490,7 @@ struct lws {
unsigned
int
extension_data_pending
:
1
;
#endif
#ifdef LWS_OPENSSL_SUPPORT
unsigned
int
use_ssl
:
3
;
unsigned
int
use_ssl
:
4
;
#endif
#ifdef _WIN32
unsigned
int
sock_send_blocking
:
1
;
...
...
This diff is collapsed.
Click to expand it.
lib/ssl-client.c
+
15
−
1
View file @
40d37e21
...
...
@@ -54,7 +54,16 @@ OpenSSL_client_verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx)
if
((
err
==
X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
||
err
==
X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN
)
&&
wsi
->
use_ssl
&
LCCSCF_ALLOW_SELFSIGNED
)
{
lwsl_notice
(
"accepting self-signed certificate
\n
"
);
lwsl_notice
(
"accepting self-signed certificate (verify_callback)
\n
"
);
X509_STORE_CTX_set_error
(
x509_ctx
,
X509_V_OK
);
return
1
;
// ok
}
else
if
((
err
==
X509_V_ERR_CERT_NOT_YET_VALID
||
err
==
X509_V_ERR_CERT_HAS_EXPIRED
)
&&
wsi
->
use_ssl
&
LCCSCF_ALLOW_EXPIRED
)
{
if
(
err
==
X509_V_ERR_CERT_NOT_YET_VALID
)
lwsl_notice
(
"accepting not yet valid certificate (verify_callback)
\n
"
);
else
if
(
err
==
X509_V_ERR_CERT_HAS_EXPIRED
)
lwsl_notice
(
"accepting expired certificate (verify_callback)
\n
"
);
X509_STORE_CTX_set_error
(
x509_ctx
,
X509_V_OK
);
return
1
;
// ok
}
...
...
@@ -138,8 +147,13 @@ lws_ssl_client_bio_create(struct lws *wsi)
}
#endif
#ifndef USE_WOLFSSL
#ifndef USE_OLD_CYASSL
/* OpenSSL_client_verify_callback will be called @ SSL_connect() */
SSL_set_verify
(
wsi
->
ssl
,
SSL_VERIFY_PEER
,
OpenSSL_client_verify_callback
);
#endif
#endif
#ifndef USE_WOLFSSL
SSL_set_mode
(
wsi
->
ssl
,
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment