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

Add standalone TLS example #205

Open
gavv opened this issue Dec 19, 2022 · 15 comments · May be fixed by #436
Open

Add standalone TLS example #205

gavv opened this issue Dec 19, 2022 · 15 comments · May be fixed by #436
Assignees
Labels
examples Improvements or additions to usage examples good first issue Good for newcomers help wanted Contributions are welcome

Comments

@gavv
Copy link
Owner

gavv commented Dec 19, 2022

Add new example to _examples directory (say, tls.go and tls_test.go) that runs small TLS server with hardcoded certificates and tests it using httpexpect. Example can be based on https://go.googlesource.com/go/+/dev.boringcrypto/src/crypto/tls/example_test.go

Add link to new example to README: https://github.com/gavv/httpexpect#examples

@gavv gavv added tests Improvements or additions to tests help wanted Contributions are welcome examples Improvements or additions to usage examples and removed tests Improvements or additions to tests labels Dec 19, 2022
@gavv gavv added the good first issue Good for newcomers label Jan 29, 2023
@antara-gandhi
Copy link
Contributor

hi @gavv, could i work on this issue? i'm pretty new to open source contributing, but i'd like to attempt this. i actually have a final project for my EECS 481 class at the University of Michigan that asks us to contribute to open source. i have some past experience in Go, but i was wondering if you had any suggestions for how i can get started here? thanks!

@gavv
Copy link
Owner Author

gavv commented Mar 29, 2023

You're welcome! Feel free to ask questions, but please be more specific: what exactly is unclear or what problem you have.

@antara-gandhi
Copy link
Contributor

It seems like the tests should pretty much exactly be the example, so I am confused on what exactly needs to be changed to create tests for tls.go? but the examples in the readme look a lot less complicated so i'm just unsure where to go from here, especially in terms of creating the certificate. should i just make my own like in the example?

@gavv
Copy link
Owner Author

gavv commented Mar 29, 2023

Yes, tls_test.go can be pretty simple, for example just make one GET request and validate received JSON, using httpexpect. The key point is providing minimal but complete setup for TLS server + httpexpect client that uses https:// and a valid certificate.

We have e2e_tls_test.go, which uses https://, but instead of using a valid certificate, it just disables TLS checks. It's OK for our tests, but is not very helpful as an example for real use cases.

If you follow the link in the issue, you can find a minimal Go server and client that use hard-coded TLS certificates. I suggest to base our example on that code.

Yes, I think it's a good idea to generate our own certificate (for demo purposes), but at the beginning of your work you can copy certs and keys from the linked code, and change it later when everything else is working.

@antara-gandhi
Copy link
Contributor

ok sounds good, i'll start working on this then! also, i was looking around the repo and saw that there was a discord chat link, but it seems like the link is expired. could that be updated? or is there a seperate way to get help if needed (should i post questions here or somewhere else?)

@gavv
Copy link
Owner Author

gavv commented Mar 30, 2023

Yes, discord chat is a good place for things like that.

Strange, I just tested the link in incognito, and it worked for me. Also some people have recently joined via that link.

Could you maybe send a screenshot with error you're getting?

@antara-gandhi
Copy link
Contributor

i actually figured it out, but thank you! i think it was a problem on my side, but i'm in the server now :) thanks!

@gavv
Copy link
Owner Author

gavv commented Oct 1, 2023

@antara-gandhi Hi, do you still have plans on this?

@gavv gavv added the waiting reply Waiting for reply from reporter or contributor label Oct 1, 2023
@gavv gavv pinned this issue Oct 5, 2023
@gavv
Copy link
Owner Author

gavv commented Oct 8, 2023

Unassigning, so that someone could pick it up

@gavv gavv removed the waiting reply Waiting for reply from reporter or contributor label Oct 8, 2023
@yoktoJH
Copy link

yoktoJH commented Oct 17, 2023

@gavv If its still available, I can work on it.

@gavv
Copy link
Owner Author

gavv commented Oct 17, 2023

Sure, thanks!

@guidovisk1
Copy link

Hello @gavv , I´m tryng to enter in this world of open source and I think that this issue could be a good start. It still open ?
Thanks, guidovisk1 !

@gavv
Copy link
Owner Author

gavv commented Nov 9, 2023

@yoktoJH Hi, are you working on the issue?

@yoktoJH
Copy link

yoktoJH commented Nov 9, 2023

@yoktoJH Hi, are you working on the issue?

Yea, it should be done by the end of the week. Sorry for no updates.

@yoktoJH
Copy link

yoktoJH commented Nov 12, 2023

I'm sorry, I wasn't able to finish it today. I had a few issues generating new certificates, but hopefully tomorrow is the day.

@yoktoJH yoktoJH linked a pull request Nov 13, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Improvements or additions to usage examples good first issue Good for newcomers help wanted Contributions are welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants