Skip to content

Separate server name #174

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 2 commits into from
Jul 19, 2018
Merged

Conversation

RonEld
Copy link
Contributor

@RonEld RonEld commented Jun 5, 2018

Seperate the server_name into the server_addr
which is the address to connect,
and to server_name which is the server host_name.
Sometimes these are not the same, and it helps separating them for connecting to other servers

Seperate the server_name into the `server_addr`
which is the address to connect,
and to `server_name` which is the server host_name.
Sometimes these are not the same
Copy link

@andresag01 andresag01 left a comment

Choose a reason for hiding this comment

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

@RonEld: I think I am happy with the changes, but before approving: what use case do you have in mind for this case? I can see this could be very useful when using the SNI extension, but I dont think thats the case here. Please remember that this is supposed to be a simple example of a tls client and adding more features generally tends to make it harder to follow...

server_port(in_server_port),
/* The platform context is passed just in case any crypto calls need it.
* Please refer to https://github.com/ARMmbed/mbedtls/issues/1200 for more
* information. */
platform_ctx(in_platform_ctx)

Choose a reason for hiding this comment

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

Could you please remove this whitespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@RonEld
Copy link
Contributor Author

RonEld commented Jun 6, 2018

@andresag01 I agree that the examples should be simple,
I have encountered several times that the server addr is different than the server name in the CN of the server's certificate. This application is used for reference and POC with different servers.
For example, if you use the example Mbed TLS server on your PC (ssl_server2), and you want to connect your board to your server, you will need a different server address ( your PC's IP \ computer name ) and server Name ( the CN of the default test certificate - localhost)
I have managed to connect to real servers ( MQTT servers in my case ), where the certificate CN was different than the server address.
If the hostname isn't equal to the Subject CN of the certificate, then certificate verification fails

@andresag01
Copy link

@RonEld: Thanks for answering my question. I will approve the PR after the whitespace is removed.

Remove an additional extra line added by a merge conflict.
@RonEld
Copy link
Contributor Author

RonEld commented Jun 6, 2018

@andresag01 I removed the extra whitespace which was accidentally introduced in a merge conflict resolution

@andresag01
Copy link

All the relevant tests in the CI pass.

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

Successfully merging this pull request may close these issues.

4 participants