Hi <@U04LLRDNURF> you can create/edit/delete stubs...
# general
t
Hi @Ramesh Hosmani you can create/edit/delete stubs and a load of other things via WireMock’s own REST API, which lives under the
/__admin/
path. You can hit this directly with curl, Postman or any other HTTP client. Check out https://wiremock.org/docs/api/ for reference, https://wiremock.org/docs/stubbing/ for examples.
r
Hello @Tom Thanks for the suggestion i need to connect to the server using truststore and keystore I did not find in the doc
Let me know if we have any east way to do it Right now i am using
Copy code
import requests
from OpenSSL import SSL

# Load the keystore and truststore
keystore = SSL.Context(SSL.SSLv23_METHOD)
keystore.use_privatekey_file('key.pem')
keystore.use_certificate_file('certificate.pem')

truststore = SSL.Context(SSL.SSLv23_METHOD)
truststore.load_verify_locations('truststore.pem')

# Create the session
session = requests.Session()
session.verify = '/truststore.pem'

# Send a GET request to the WireMock server
response = session.get('<https://elk.build.soasta.com:8443/__admin/mappings>', cert=('/key.pem'))

# Print the response body
print(response.text)
print(response.status_code)
This client to connect to it
I am able to connect to
__admin
through browser Thanks Tom
t
Just so I understand correctly - you’re trying to get your Python client to trust WireMock’s self-signed certificate so you can connect over HTTPS (rather than HTTP)?
r
Yes
But i was not aware of the ui which lets me create stubs, above links which you posted was useful as well
t
You can download a PEM encoded copy of WireMock’s cert from: http://localhost:8080/__admin/certs/wiremock-ca.crt (substituting whatever HTTP port you’ve allocated)
And yes, WireMock Cloud has a CA signed certificate on all HTTPS endpoints so you don’t need to do anything special in your client in order for it to be trusted.
👍 1