Skip to content

Comments

Generalize HTTP server code from apps/ocsp.c to apps/lib/http_server.c#11736

Closed
DDvO wants to merge 4 commits intoopenssl:masterfrom
siemens:extract_http_server
Closed

Generalize HTTP server code from apps/ocsp.c to apps/lib/http_server.c#11736
DDvO wants to merge 4 commits intoopenssl:masterfrom
siemens:extract_http_server

Conversation

@DDvO
Copy link
Contributor

@DDvO DDvO commented May 5, 2020

This is a further spin-off PR of #11470 as requested by @mattcaswell: #11470 (comment).

This adds apps/lib/http_server.c and apps/include/http_server.h
simplifying apps/ocsp.c. This going to be used also for apps/cmp.c
and will be helpful as well for any future app acting as an HTTP server.

This PR also contains a couple of related fixes as separate commits:

  • Fix bio_wait() in crypto/bio/bio_lib.c in case OPENSSL_NO_SOCK
  • Constify 'req' parameter of OSSL_HTTP_post_asn1()
  • Fix bug in OSSL_CMP_SRV_process_request() on transaction renewal

Copy link
Member

@mattcaswell mattcaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. A couple of comments below.

I wonder if @vdukhovni might have some cycles to look at it?

@DDvO DDvO added this to the 3.0.0 milestone May 8, 2020
@DDvO
Copy link
Contributor Author

DDvO commented May 8, 2020

Thanks @mattcaswell and @vdukhovni for your reviews and comments.
I've addressed all of them.

Copy link
Member

@mattcaswell mattcaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved assuming the minor nit is fixed.

@mattcaswell mattcaswell added approval: done This pull request has the required number of approvals branch: master Applies to master branch labels May 8, 2020
DDvO added 4 commits May 8, 2020 14:47
Also adds apps/include/http_server.h.
This is used so far by apps/ocsp.c and is going to be used for apps/cmp.c
and will be helpful also for any future app acting as HTTP server.
@DDvO DDvO force-pushed the extract_http_server branch from c19fd14 to b32b30b Compare May 8, 2020 12:50
@DDvO
Copy link
Contributor Author

DDvO commented May 8, 2020

Approved assuming the minor nit is fixed.

Thanks for your swift reaction!
I've fixed the doc nit and partly squashed the commit structure for merging tomorrow.

Copy link

@vdukhovni vdukhovni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good.

@vdukhovni
Copy link

vdukhovni commented May 8, 2020

It would have been cool to leverage a ubiquitous light-weight HTTP server library in C, with a suitable license instead of rolling our own, but the only one that comes to mind (libmicrohttpd) is LGPL. Mind you, we only use the HTTP server in "apps", it wouldn't be quite so bad to have it be runtime linked to an LGPL library, but we'd still need to something on systems where that's not available. Anyone know of suitable alternatives?

@vdukhovni
Copy link

It would have been cool to leverage a ubiquitous light-weight HTTP server library in C, with a suitable license instead of rolling our own, but the only one that comes to mind (libmicrohttpd) is LGPL. Mind you, we only use the HTTP server in "apps", it wouldn't be quite so bad to have it be runtime linked to an LGPL library, but we'd still need to something on systems where that's not available. Anyone know of suitable alternatives?

Anyone have any experience good/bad with libhttp? The license is MIT, so not a problem...

@openssl-machine
Copy link
Collaborator

24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually.

@DDvO DDvO added the approval: ready to merge The 24 hour grace period has passed, ready to merge label May 9, 2020
@DDvO
Copy link
Contributor Author

DDvO commented May 9, 2020

Merged - thanks @mattcaswell and @vdukhovni!

openssl-machine pushed a commit that referenced this pull request May 9, 2020
Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Viktor Dukhovni <[email protected]>
(Merged from #11736)
openssl-machine pushed a commit that referenced this pull request May 9, 2020
Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Viktor Dukhovni <[email protected]>
(Merged from #11736)
openssl-machine pushed a commit that referenced this pull request May 9, 2020
Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Viktor Dukhovni <[email protected]>
(Merged from #11736)
openssl-machine pushed a commit that referenced this pull request May 9, 2020
Also adds apps/include/http_server.h.
This is used so far by apps/ocsp.c and is going to be used for apps/cmp.c
and will be helpful also for any future app acting as HTTP server.

Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Viktor Dukhovni <[email protected]>
(Merged from #11736)
@DDvO
Copy link
Contributor Author

DDvO commented May 9, 2020

It would have been cool to leverage a ubiquitous light-weight HTTP server library in C, with a suitable license instead of rolling our own

I agree this would make sense at least instead of trying to extend this very rudimentary HTTP server implementation, which would be a mayor endeavor.
The same I'd say holds for the HTTP client merged in #10667, which is somewhat more advanced but also far from being complete and already took quite some effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: done This pull request has the required number of approvals approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Applies to master branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants