예제 #1
0
 def _build_session(self, session=None):
     APISession._build_session(self, session)
     # As Tenable.sc is generally installed without a certificate chain that
     # we can validate, we will want to turn off verification and the
     # associated warnings unless told to otherwise:
     self._session.verify = self._ssl_verify
     if not self._ssl_verify:
         warnings.filterwarnings('ignore', 'Unverified HTTPS request')
예제 #2
0
 def _build_session(self, session):
     '''
     Build the session and add the API Keys into the session
     '''
     APISession._build_session(self, session)
     self._session.trust_env = False
     self._session.headers.update(
         {'Authorization': 'Bearer {}'.format(self._api_key)})
예제 #3
0
 def _build_session(self):
     '''
     Build the session and add the API Keys into the session
     '''
     APISession._build_session(self)
     self._session.headers.update({
         'X-APIKeys': 'accessKey={}; secretKey={};'.format(
             self._access_key, self._secret_key)
     })
예제 #4
0
 def _build_session(self):
     '''
     Build the session and add the API Keys into the session
     '''
     APISession._build_session(self)
     self._session.headers.update({
         'X-APIKeys':
         'accessKey={}; secretKey={};'.format(self._access_key,
                                              self._secret_key)
     })
     '''
     Add SSL Verification flag
     '''
     self._session.verify = self._verify