Hi Chris,
I indeed got a certificate error, but disabled certificate verification while testing. So this issue does not seem to be caused by certificate issues.
My python code, which works for the poloniex wamp api (no authentication needed there), is as follows:
Code:
#!/usr/bin/env python3
import ssl
from autobahn.asyncio.wamp import ApplicationSession
from autobahn.asyncio.wamp import ApplicationRunner
from autobahn.wamp import auth
try:
import asyncio
except ImportError:
# Trollius >= 0.3 was renamed
import trollius as asyncio
user = "web"
secret = "wampUser"
class ProhashingComponent(ApplicationSession):
def onConnect(self):
self.join(self.config.realm, [u"wampcra"], user)
def onChallenge(self, challenge):
if challenge.method == u"wampcra":
print("WAMP-CRA challenge received: {}".format(challenge))
if u'salt' in challenge.extra:
# salted secret
key = auth.derive_key(secret,
challenge.extra['salt'],
challenge.extra['iterations'],
challenge.extra['keylen'])
else:
# plain, unsalted secret
key = secret
# compute signature for challenge, using the key
signature = auth.compute_wcs(key, challenge.extra['challenge'])
# return the signature to the router for verification
return signature
else:
raise Exception("Invalid authmethod {}".format(challenge.method))
@asyncio.coroutine
def onJoin(self, details):
def onProfitabilityUpdates(*args):
print("Profitability Updates event received:", args)
try:
yield from self.subscribe(onProfitabilityUpdates, 'profitability_updates')
except Exception as e:
print("Could not subscribe to topic:", e)
def main():
context = ssl.create_default_context()
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
runner = ApplicationRunner(u"wss://live.prohashing.com:443/ws", u"mining", ssl=context)
#runner = ApplicationRunner(u"wss://prohashing.com:444/ws", u"mining", ssl=context)
runner.run(ProhashingComponent)
if __name__ == "__main__":
main()
The wampcra imlementation comes straight from the autobahn examples.
Hope this helps.
Best,
Maznoz