-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
feat(microservice): TCP microservice over TLS #10628
Conversation
Signed-off-by: nomaxg <noahgolub2@gmail.com>
Pull Request Test Coverage Report for Build ab5aa6c9-6cd1-41e3-99b5-fb1f16ae7606
💛 - Coveralls |
I'm not sure how to address the samples failure, the failing sample appears to build and run fine for me locally. Any suggestions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you mixed ConnectionOptions
and TlsOptions
packages/microservices/interfaces/microservice-configuration.interface.ts
Outdated
Show resolved
Hide resolved
packages/microservices/interfaces/microservice-configuration.interface.ts
Outdated
Show resolved
Hide resolved
thanks! updated |
Actually I believe that the configuration was correct before - |
if (!this.tlsOptions) { | ||
this.socket.connect(this.port, this.host); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reason for moving this up? We should also add an inline comment on why "connect" is not required for tls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this back to its original location, added a comment
Signed-off-by: nomaxg <noahgolub2@gmail.com>
Thanks for the review, @kamilmysliwiec. Fixed the samples failure by using |
LGTM |
Would you like to create a PR to the docs (with an additional section about this feature) @nomaxg? This could be based off this PR nestjs/docs.nestjs.com#1961 |
sure! I'll work on it |
Builds off of @Flusinerd's work to add the option to connect to a TCP microservice over TLS.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Adds the ability to pass through TLS options to both the client and the server by means of an optional
tlsOptions
property.What is the current behavior?
Issue Number: #6745
What is the new behavior?
If
tlsOptions
are specified, a tls server will be instantiated server-side, and a TLSSocket will be used to connect to the server client-side. Under the hood, options are passed down to the Node tls library.Does this PR introduce a breaking change?
Other information