How to POST a REST api using ClientRequest with pem files - post

I am having a resteasy application and trying to push mqtt data over https to AWS IoT core service.
I have a Curl command (with --tlsv1.2 enabled) with which I am able to publish the data to AWS. It is a POST request with cacert, cert and private keys file path (passed as .pem files). Now I need to achieve the same using rest easy application.
I am not sure how to pass the pem certificate files in a ClientRequest.
Any sort of help would be appreciated.
Thanks in advance.
With curl command able to publish the data trying to achieve the same with a rest easy application.

Related

Does the docker version of opennms have Rest API?

I am building a frontend-like for OpenNMS and chose to install OpenNMS in a docker container. I need to use the Rest API to further my project and when I try to send a request to
http://localhost:8980/opennms/rest, using the python requests library the return code is 404.
Does OpenNMS for docker not have Rest API or do I need to install it on my core system instead of docker.
P.S. This is my first time trying to do use the Rest API of an application.
imgur link : https://imgur.com/5UDPjRF
The URL you are calling is just the base URL for our rest resources. For Nodes as an example, you can test this with curl -u admin http://localhost:8980/opennms/rest/nodes. The REST API endpoints are described in the documentation here

Https in .net core web api app in docker container

I have ASP.NET Core Web Api application. Also I have (not my) remote REST service which is accessible by https using GOST algorithms. I'm doing GET request from my service to this secure remote service. To access remote server I have public and private parts of the key which are in cer and pem files. Moreover, my app is working in docker app.
I can do request with curl from docker container:
curl https://someserver.com -v --cert /app/cert/certificate.cer --key /app/cert/privatekey.pem --insecure
But how can I do it using HttpClient? Or other class from my code?
After googling and experiments i'm at the point of view that this is not possible now using .net core 2.1 in such environment without third party libraries (i even didn't find any of them) or linux packets. I can't load pem file and i'm always getting SSL handshake error from code.
P.S. I'm using rnix/openssl-gost:stretch docker image for GOST support on linux.

Elasticsearch https and Nest client connection with ssl certificate

I am trying to implement Elasticsearch 5.x with https(using Safeguard) and NEST client.
I am failing on, how to generate a X509certificate of Elasticsearch installed in server.
Found some code in below link how to create a NEST connection to Elasticsearch with X509 certificate.
How to use X509 certificate with the Nest Elastic Client
But I have no idea how to achieve this. I need to know how the below things:
How to generate a X509 certificate of Elasticsearch 5.x(Elasticsearch installed in a server and is accessible through some url like https://elas:9300)
What could be the value for "path_to_cert" in the above link's answer(I understood it is the path to X509 certificate file). It need to be a shared path or that certificate need to be included in application
I tried searching all the web and still no idea. Please help on this.
Thanks in advance.
Your question is not clear if it is about the Elasticsearch server to configure, or only the client. Is the server already running with SSL (is it reachable at https://elas:9300 ?). If no, then you need to create a java keystore containing a self-signed certificate (I suppose it's enough for your need). If already running in SSL and your question is only about the client, then store the certificate that you can get when browsing https://elas:9300 in this file that you suggested (path_to_cert)

Getting Error with SSL Certificate in swift

ERROR:(You can't able to connect server without SSL certificate)
I have to use fullchain.pem file. How can I use that fullchain.pem file in my project to access the server and retrive the secure information from the server(fullchain.pem file was given by my backend team)
Please help me...
Advanced Thanks

APNS setup for the server

I'm trying to setup our APNS server. I was looking at the instructions on this page:
http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
I'm understanding everything. Problem is that I have a website already SSL enables (SSL terminates at the load balancer) on AWS, following these instructions a while back:
"Public key certificate and private key doesn't match" when using Godaddy issued certificate
The website for APNS is telling me to get a CSR file, etc. But if I already have this SSL certification done, does it mean I have to start from scratch and re-key my key? :( I wasn't able to find information regarding this...
The APNS CSR has nothing to do with any certificates you already have.
You have to create certificates in the developer area of apples websites. You don't install those certificates to the web server... they are only used from the php script on your server to connect to the apple server as a client. Your script has to load them while they run.. but they are not installed in the web server or load balancer.

Resources