-
Notifications
You must be signed in to change notification settings - Fork 190
Report SSL error messages from serf #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -451,6 +451,23 @@ ssl_server_cert_cb(void *baton, int failures, | |
| return save_error(session, err); | ||
| } | ||
|
|
||
| #if defined(HAVE_SERF_SSL_ERROR_CB_SET) | ||
| static apr_status_t | ||
| ssl_error_cb(void *baton, apr_status_t status, | ||
| const char *message) | ||
| { | ||
| svn_ra_serf__connection_t *conn = baton; | ||
| svn_ra_serf__session_t *session = conn->session; | ||
|
|
||
| session->ssl_error = svn_error_createf(status, | ||
| session->ssl_error, | ||
| _("TLS: %s"), | ||
| message); | ||
|
|
||
| return APR_SUCCESS; | ||
| } | ||
| #endif | ||
|
|
||
| static svn_error_t * | ||
| load_authorities(svn_ra_serf__connection_t *conn, const char *authorities, | ||
| apr_pool_t *pool) | ||
|
|
@@ -567,7 +584,14 @@ conn_setup(apr_socket_t *sock, | |
| SERF_CONNECTION_FRAMING_TYPE_NONE); | ||
| } | ||
| #endif | ||
| } | ||
|
|
||
| #if defined(HAVE_SERF_SSL_ERROR_CB_SET) | ||
| serf_ssl_error_cb_set(conn->ssl_context, | ||
| ssl_error_cb, | ||
| conn); | ||
| #endif | ||
|
|
||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Formatting-nerd: Is there a tab vs space issue hiding here? |
||
|
|
||
| if (write_bkt) | ||
| { | ||
|
|
@@ -958,7 +982,14 @@ svn_ra_serf__context_run(svn_ra_serf__session_t *sess, | |
| _("Error running context")); | ||
| } | ||
|
|
||
| return svn_ra_serf__wrap_err(status, _("Error running context")); | ||
| if (sess->ssl_error) | ||
| { | ||
| return sess->ssl_error; | ||
| } | ||
| else | ||
| { | ||
| return svn_ra_serf__wrap_err(status, _("Error running context")); | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It also strikes me that the then you can just call svn_ra_serf__wrap_error(status, sess->ssl_error, ...`.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change makes a lot of sense, but we touch a lot of files. Is it ok to commit this in one step, or should this be a separate change?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right. This can wait until after this PR is merged, and can happen on trunk in one commit. I suspect that when the proposal for |
||
| } | ||
|
|
||
| return SVN_NO_ERROR; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to self: Do we need to implement something similar for CMake ?