Skip to content
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

(followup to old bug report) clientcert never initialized (IDFGH-6652) #8288

Closed
dannybackx opened this issue Jan 25, 2022 · 2 comments
Closed
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@dannybackx
Copy link

See #7479 .
That solution is now in esp-idf-v4.4-rc1, thanks.

Suggestion to not only call user_cb at session creation but also from httpd_ssl_close to assist the application in managing its own state. (If the application does more than just cope with short sessions, then managing long ones is hard without this additional call to assist in cleanup.)

@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 25, 2022
@github-actions github-actions bot changed the title (followup to old bug report) clientcert never initialized (followup to old bug report) clientcert never initialized (IDFGH-6652) Jan 25, 2022
@dannybackx
Copy link
Author

I can see several ways of doing that. The fundamental problem is that you can't pass much info (one parameter) into httpd_ssl_close, and information is scattered (the https_server uses leftover fields in httpd sess_db to store its stuff). Lookups in the sess_db require two parameters, not one.

Solution 1 is to allocate another structure to pass to httpd_ssl_close, with all the desired fields. That's a workaround for the problem above, and would not touch httpd_server coding.

Solution 2 could be to expose sess_db to https_server. Then it would be able to grab the global_ctx and call user_db from there.

I'm sure there are other ways. I can code a sample if you tell me how.

@dannybackx
Copy link
Author

Here is a sample implementation based on my suggestion #1 above
d.txt
.

@espressif-bot espressif-bot added Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

2 participants