Added logic to find CA certs for SSL connections (for frozen apps) and added some logging

This commit is contained in:
blitzmann
2015-10-24 23:32:15 -04:00
parent c04b7e0552
commit 167eb60fe3
4 changed files with 20 additions and 4 deletions

View File

@@ -10,7 +10,9 @@ import service
from service.server import *
import config
from gui.utils.repeatedTimer import RepeatedTimer
import logging
logger = logging.getLogger(__name__)
class Crest():
@@ -29,6 +31,7 @@ class Crest():
def __init__(self):
self.settings = service.settings.CRESTSettings.getInstance()
self.httpd = StoppableHTTPServer(('', 6461), AuthHandler)
logger.debug(self.httpd)
self.scopes = ['characterFittingsRead', 'characterFittingsWrite']
self.state = None
@@ -96,15 +99,15 @@ class Crest():
return self.eve.auth_uri(scopes=self.scopes, state=self.state)
def handleLogin(self, message):
self.httpd.stop()
if not message:
return
if message['state'][0] != self.state:
print "state mismatch"
logger.warn("OAUTH state mismatch")
return
print "handling login by making characters and stuff"
print message
logger.debug("Handling CREST login with: %s"%message)
if 'access_token' in message: # implicit
eve = copy.copy(self.eve)
@@ -117,6 +120,9 @@ class Crest():
eve()
info = eve.whoami()
logger.debug("Got character info: %s" % info)
self.implicitCharacter = CrestUser(info['CharacterID'], info['CharacterName'])
self.implicitCharacter.eve = eve
self.implicitCharacter.fetchImage()
@@ -128,6 +134,8 @@ class Crest():
eve()
info = eve.whoami()
logger.debug("Got character info: %s" % info)
# check if we have character already. If so, simply replace refresh_token
char = self.getCrestCharacter(int(info['CharacterID']))
if char:

View File

@@ -9,6 +9,10 @@ from wx.lib.pubsub import pub
from html import HTML
import logging
logger = logging.getLogger(__name__)
# https://github.com/fuzzysteve/CREST-Market-Downloader/
class AuthHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):