Skip to content

Minor cleanup of SSL server methods, missing macros #4280

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

Merged
merged 3 commits into from
Feb 6, 2018

Conversation

earlephilhower
Copy link
Collaborator

The first of these commits removes duplicated code for loading certs. There's already a method to do this, so the add'l ones added for support of ESP8266WiFiServerSecure were not needed.

The second one fixes a compile error found in the WebServerSecure class when HTTP_SERVER debugging is enabled. The output macro wasn't brought in from the original, non-secure file.

@earlephilhower earlephilhower requested a review from devyte February 2, 2018 21:12
@d-a-v
Copy link
Collaborator

d-a-v commented Feb 3, 2018

#4274 collision :) I'll update mine

memcpy_P(stackData, cert, certLen);
_ssl->loadServerX509Cert(stackData, certLen);
}
if (rsakey && rsakeyLen) _ssl->loadObject_P(SSL_OBJ_RSA_KEY, rsakey, rsakeyLen);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please no 1-line if statements. Just put the _ssl line indented under the if.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My bad! I try and cuddle all if{}s but sometimes one just slips by on me. I've seen too many spots where folks have a 1-line, uncuddle'd if and decide "I'll put in a debug statement here" and end up changing the logic.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to apologize! Cross code reviews are meant to catch forests after working on the trees, or something like that :P

@devyte
Copy link
Collaborator

devyte commented Feb 4, 2018

My one comment is just about readability

The server needs to load an X509 and RSK key, but instead of using
the existing loadObject() calls implemented its own.  Remove them and
use the standard ones instead.

The DEBUG_OUTPUT macro was undefined in the SSL Web server.  Add it
in do that when you compile with DEBUG=HTTP_SERVER it actually compiles.
@earlephilhower earlephilhower merged commit 4c23e66 into esp8266:master Feb 6, 2018
@earlephilhower earlephilhower deleted the https_update branch March 9, 2018 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants