How can I secure a Spyne web service with SSL? - ssl

I'm trying to get a SOAP web service set up with Spyne. So far, so good. I have a web service,but not I need to secure the data in-flight with SSL. Is there a way to attach a certificate to the Spyne app so my connection is encrypted?
Thank you!
I've looked at the help guides on Spyne.io and have not found the info I need about SSL.

You need to use either a reverse proxy setup (like nginx) that will terminate the SSL connection outside of the Python process (recommended) or you have to use OpenSSL (or similar) bindings to create an SSL socket for yourself.
You can use twisted's ssl capabilities via the WsgiApplication. Have a look: https://twisted.readthedocs.io/en/twisted-17.9.0/web/howto/using-twistedweb.html

Related

Intercept requests in SSL WebSocket connection (wss)

I have a WSS server running, and I want to intercept WebSocket messages between the client and the server.
I am able to intercept WebSocket messages using WS (no SSL) but haven't had any success with WSS (with SSL). I am getting an error about self-signed certs, which my testing client (wscat) doesn't want to use. (self signed certificate in certificate chain)
And lastly, how would I be able to intercept a connection from a different desktop application? So say if application A is trying to connect to a WSS server, how would I intercept that without telling the desktop application to use a proxy?
Thank you!
Unrelated to the question above, but I am also not able to proxy HTTPS requests because of this error:
sslv3 alert bad certificate
I am getting an error about self-signed certs, which my testing client (wscat) doesn't want to use.
This question is really is about wscat and not mitmproxy. https://stackoverflow.com/a/58149466/934719 mentions that you can pass -n to wscat to disable certificate checks for local testing.
And lastly, how would I be able to intercept a connection from a different desktop application? So say if application A is trying to connect to a WSS server, how would I intercept that without telling the desktop application to use a proxy?
If you cannot tell the desktop application to use a proxy, then it's probably the easiest to set up as a reverse proxy.

How to serve https requests in Ktor programmatically

To serve https requests in Ktor, their documentation states you need to set some config properties (ktor.security.ssl) in application.conf, such that Ktor can find the ssl certificate. However, I want to retrieve the ssl certificate from another server (via an encrypted connection).
Can I setup my Ktor server in such a way that I retrieve this certificate and enable https on server startup?
If anyone is still wondering about this, the way to do this is to start your Ktor server as an embedded server and supply it with your own ApplicationEngineEnvironment (As a reference you can use the function io.ktor.server.engine.CommandLine.Kt).
In this ApplicationEngineEnvironment you can customize the way the SSL certificate is loaded.

Window Service to Client Communication via SSL certificate

I am using Window Service as server to send data to window application as client.
I want to secure its communication via SSL encryption.
Bad luck in finding any guide to do this.
Anyone have idea about implement client server secure communication via ssl in window service please tell me.

Websockets on localhost over https:// problems

I'm trying to write a service, my service is a WebsocketServer is written in nodejs, with express and the ws module. This service should be installed with node-webkit locally on a computer(on localhost) to communicate with a web site in https:// to exchange information. My problem is, that i need a trusted certificate for localhost(its not possible), because all browsers give a warning if i use a self signed certificate. I know i can ignore that warning, but in the future this software should be distribuited, and i dont want to give that warning for future clients. Is there a good way to resolve this problem?
Use one of the following options to work around this:
Package your client-side interface as a browser extension
Setup a Message Queue which transforms messages to your node server as Websocket requests
Use a PAAS provider with free certificates to proxy to your domain
References
How do I use a self signed certificate for a HTTPS Node.js server?
Simulating GitHub OAuth2 Login for Tests with JUnit, Webdriver & Hoverfly
Apache configuration using Self Signed Certificate - YouTube
Amazon SES: Sendmail
SMTP Gateway Plugin for RabbitMQ
Sending RabbitMQ messages via websockets

Nginx two-way authentication between two play services

I have two remote servers that run two play framework services (client, server) and I want to configure SSL mutual Authentication between them.
Iam using Nginx as a reverse proxy to the server and Iam trying to use Nginx as forward proxy in front of the client.
The reverse proxy works perfectly and I tested it by importing the client certificate to a browser and tested authentication. My problem in the client server I need to configure Nginx on the client server as forward proxy to send the client certificate in its request.
Can Nginx do that (I googled a lot and I can't find a way). Or will I have to use Apache or squid as forward proxy?
Is there a better way to do the mutual SSl Authentication between the two servers?
Thanks in advance for any guidance.
nginx doesn't support two-way/mutual authentication using client cert/key.
I have added support for mutual auth for connecting to upstream weblogic server.
See the patch details:
https://github.com/nginx/nginx/pull/7
http://mailman.nginx.org/pipermail/nginx-devel/2014-August/005817.html