aristanetworks/robotframework-aristalibrary

SSL

Closed this issue · 5 comments

SSL

I am trying to use the robot framework but I don't see a way to set the verify=false and therefore my SSL is failing on my connection to eapi.

Suite setup failed:
ConnectionError: Socket error during eAPI connection: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)

Is there a way to bypass this?

Hi @drums,

The robotframework-aristalibrary uses pyeapi behind the scenes for connections to devices and pyeapi disables the certificate verification for https by default. What version of pyeapi are you using? Could you provide the connection parameters from your test file?

Thanks,
Matt

-- coding: robot --

:setf robot

:set noexpandtab

*** Settings ***
Documentation This is a sample Robot Framework suite which takes advantage of
... the AristaLibrary for communicating with and controlling Arista switches.
... Run with:
... pybot --pythonpath=AristaLibrary demo/sample-test-refactored.txt
Library AristaLibrary
Library Collections
Suite Setup Connect To Switches
Suite Teardown Clear All Connections

*** Variables ***
${TRANSPORT} https
${SW1_HOST} 10.255.255.101
${SW1_PORT} 443
${SW2_HOST} 10.255.255.102
${SW2_PORT} 443
${USERNAME} admin
${PASSWORD} arista

*** Test Cases ***
Ping Test

${output}=  Enable  ping 10.255.255.1
${result}=  Get From Dictionary ${output[0]}    result
Log ${result}
${match}    ${group1}=  Should Match Regexp ${result['messages'][0]}    (\\d+)% packet loss
Should Be Equal As Integers ${group1}   0   msg="Packets lost percent not zero!!!"

*** Keywords ***
Connect To Switches
[Documentation] Establish connection to a switch which gets used by test cases.
Connect To host=${SW1_HOST} transport=${TRANSPORT} username=${USERNAME}
... password=${PASSWORD} port=${SW1_PORT}
Connect To host=${SW2_HOST} transport=${TRANSPORT} username=${USERNAME}
... password=${PASSWORD} port=${SW2_PORT}

PYEAPI Version:
Name: pyeapi
Version: 0.8.2
Summary: Python Client for eAPI
Home-page: https://github.com/arista-eosplus/pyeapi
Author: Arista EOS+ CS
Author-email: eosplus-dev@arista.com
License: BSD-3
Location: /usr/lib/python2.7/site-packages
Requires: netaddr
Required-by: robotframework-aristalibrary

This was an issue with CentOS. I changed the bash profile to have PYTHONHTTPSVERIFY=0 and the problem was resolved.

Gotcha. Thank you for the resolution info.