Pulling LabKey data via python api | Brian Connolly | 2016-07-19 09:12 |
Status: Closed | ||
James, The problem is with your SSL certificate. You can see this by catching the error from your select_rows call. For example, if you change your script to from labkey.query import select_rows from labkey.utils import create_server_context server_context = create_server_context('52.36.10.100', 'home/db_test', use_ssl=True) try: my_results = select_rows( server_context=server_context, schema_name='study', query_name='Database' ) except labkey.exceptions.ServerContextError as e: print "Exception Code: " + str(e.exception) print "Error Message: " + str(e.message) You will see the error messages Exception Code: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581) Error Message: Failed to match server SSL configuration. Ensure the server_context is configured correctly. You are running into two SSL problems. The first is that the Common Name in the SSL certificate does not match the hostname you are using in the create_server_context call (in your example code, you are using the IP address of 52.36.10.100, which does not match the Common Name of your SSL certificate which is "William Bosl"). The second is that the SSL certificate is self-signed. If you fix both of these problem with the SSL certificate then I believe the Python api will work correctly. |
||