Bug 43035 - Add ability to wrap ssl around pre-existing sockets
Add ability to wrap ssl around pre-existing sockets
Status: NEW
Product: APR
Classification: Unclassified
Component: APR-util
HEAD
All other
: P3 enhancement (vote)
: ---
Assigned To: Apache Portable Runtime bugs mailinglist
http://people.apache.org/~nmittler/pa...
: PatchAvailable
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2007-08-04 13:05 UTC by Nathan Mittler
Modified: 2007-11-12 18:31 UTC (History)
1 user (show)



Attachments
Adds ability to wrap ssl around pre-existing sockets (4.76 KB, patch)
2007-08-04 13:06 UTC, Nathan Mittler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Mittler 2007-08-04 13:05:01 UTC
This is an enhancement request for the new ssl socket support in APR.  It would
be desirable to have the ability to create ssl sockets that are wrapped around
pre-existing tcp sockets.  I am attaching a patch that I believe has everything
that is required.
Comment 1 Nathan Mittler 2007-08-04 13:06:30 UTC
Created attachment 20599 [details]
Adds ability to wrap ssl around pre-existing sockets
Comment 2 Lucian Adrian Grijincu 2007-08-04 13:29:07 UTC
Just some cosmetics:

why doesn't the declaration of the apr_ssl_socket_create_wrapper function have
names for it's parameters? The Doxygen comments have the names, but I don't
think all IDEs parse Doxygen. Having the names in the declaration may help
programmers with IDEs which can autocomplete and show tooltips with the function
 signature. 

return APR_ENOMEM instead of ENOMEM (even though currently they are defined to
be the same, it's safer/clearer).

don't return "-1", apr_strerror doesn't understand it and it's ugly, just return
the error you got in "if (apu_ssl_socket_create(sslSock, asf) != APR_SUCCESS)".

the coding standard mandates using '_' to separate words in variable and
function names. "ownSocket => own_socket"?
Comment 3 Nathan Mittler 2007-08-04 14:01:12 UTC
(In reply to comment #2)
> Just some cosmetics:
> 
> why doesn't the declaration of the apr_ssl_socket_create_wrapper function have
> names for it's parameters? The Doxygen comments have the names, but I don't
> think all IDEs parse Doxygen. Having the names in the declaration may help
> programmers with IDEs which can autocomplete and show tooltips with the function
>  signature. 
> 
> return APR_ENOMEM instead of ENOMEM (even though currently they are defined to
> be the same, it's safer/clearer).
> 
> don't return "-1", apr_strerror doesn't understand it and it's ugly, just return
> the error you got in "if (apu_ssl_socket_create(sslSock, asf) != APR_SUCCESS)".
> 
> the coding standard mandates using '_' to separate words in variable and
> function names. "ownSocket => own_socket"?

I was following the conventions used in the files that I was editing.  I can
update my patch, but the changes should probably be made across the board. 
Perhaps there are other files outside of the ssl package that have these issues
as well?
Comment 4 Nathan Mittler 2007-10-17 10:26:55 UTC
Just checking on this issue - haven't seen any activity.  Are there any plans
for implementing this in a future release?  A patch is attached, so it should be
pretty easy to roll in.

Thanks,
Nate
Comment 5 William A. Rowe Jr. 2007-10-17 11:20:01 UTC
We are still certainly accepting proposed changes to 1.3.0, thanks for the patch!