Trying to use the python library st2client for some simple tests calling a locally running instance of stackstorm in a container on https://localhost.
from flask import Flask, request, jsonify
import pathlib
import os
import json
from st2client.client import Client
from st2client import models
app = Flask(__name__)
@app.route('/')
def hello_world():
client = Client(base_url='https://localhost', api_key='037339ce65194c19b5c61205c0f86466', debug=True)
rules = client.rules.get_all()
Results in:
$ flask run
* Serving Flask app "app.py"
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2018-12-14 15:20:32,145] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "~/Projects/stackstorm/stackstorm.api/stackstorm_env/lib/python3.6/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 438, in wrap_socket
cnx.do_handshake()
File "~/Projects/stackstorm/stackstorm.api/stackstorm_env/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1907, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "~/Projects/stackstorm/stackstorm.api/stackstorm_env/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1632, in _raise_ssl_error
raise SysCallError(-1, "Unexpected EOF")
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')
I set my stackstorm config without fixing the error.
[general]
base_url = https://localhost
api_version = v1
silence_ssl_warnings = True
Is there a way to ignore certificates?