UPDATED - Betfair.com Login - Disabling TLS Ciphers - 3rd February 2020

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts

  • aron
    replied
    Hey thanks MV, all good now!

    Leave a comment:


  • MV6man
    replied
    Hey Aron, I got mine to work (I'm running a NET version with TLS 1.2 btw) by inserting the line from the previous page so try:



    Dim postData AsString = _

    "username=" & My.Settings.Betfair_LOGIN & "&password=" & My.Settings.Betfair_PASS

    Dim cert AsNewX509Certificate2(My.Settings.FilePath_DB & "client-2048.p12", "")

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12


    Dim request AsHttpWebRequest = _

    WebRequest.Create("https://identitysso-cert.betfair.com/api/certlogin")

    request.Method = "POST"

    request.ContentType = "application/x-www-form-urlencoded"

    request.Headers.Add("X-Application: " & My.Settings.Betfair_APPKEY)

    Leave a comment:


  • aron
    replied
    My code...

    Dim postData AsString = _

    "username=" & My.Settings.Betfair_LOGIN & "&password=" & My.Settings.Betfair_PASS

    Dim cert AsNewX509Certificate2(My.Settings.FilePath_DB & "client-2048.p12", "")

    Dim request AsHttpWebRequest = _

    WebRequest.Create("https://identitysso-cert.betfair.com/api/certlogin")

    request.Method = "POST"

    request.ContentType = "application/x-www-form-urlencoded"

    request.Headers.Add("X-Application: " & My.Settings.Betfair_APPKEY)

    request.ClientCertificates.Add(cert)

    request.Accept = "application/json"

    Using dataStream AsStream = request.GetRequestStream()

    Using writer AsNew _

    StreamWriter(dataStream, Encoding.[Default])

    writer.Write(postData)

    EndUsing

    EndUsing

    … doesn't work. Please help

    Leave a comment:


  • AlexX
    replied
    Originally posted by chem View Post

    I got it. Windows Server 2008 is incompatible with TLS1.2
    for win2008 does not work. need a min win2012

    try to install it as an option win2008
    https://support.microsoft.com/en-gb/...rotocols-in-wi
    Last edited by AlexX; 05-02-2020, 07:59 AM.

    Leave a comment:


  • clacherholiday2
    replied
    I wont be able to fix this for 2 weeks now judging by the solutions posted elsewhere, I need physical access to the machine to make offline changes, absolutely fing furious.

    Ive been running the same system forever without a hint of a problem, why were these changes made now?
    Last edited by clacherholiday2; 05-02-2020, 07:49 AM.

    Leave a comment:


  • chem
    replied
    Originally posted by chem View Post
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

    It didn't work for me I already updated .net framerwork to 4.6 and tls 1.2 is available now but it has the same behavior.
    I'm using windows server 2008 r2.
    Is this a problem? How can I check which protocol is being used? I can login easily with curl.
    Some help much appreciated
    I got it. Windows Server 2008 is incompatible with TLS1.2

    Leave a comment:


  • chem
    replied
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

    It didn't work for me I already updated .net framerwork to 4.6 and tls 1.2 is available now but it has the same behavior.
    I'm using windows server 2008 r2.
    Is this a problem? How can I check which protocol is being used? I can login easily with curl.
    Some help much appreciated

    Leave a comment:


  • MV6man
    replied
    Thanks Zeal, the code

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

    worked for me!

    Leave a comment:


  • AlexX
    replied
    ReImage VPS server 2012!!! It works! Thank you

    Leave a comment:


  • AlexX
    replied
    net 4.8 and server 2012

    everything is correct in the program code. The bot works on another PC (win 2010). Stopped working on win server 2012 !!!

    Leave a comment:


  • LetsGo
    replied
    I would say that you need to make sure you have the latest version of .net (4.5 or over at least)

    Leave a comment:


  • zeal
    replied
    Originally posted by AlexX View Post
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

    Does not work need help
    I am not the expert you need, but I can tell what I have done to fix my program.

    I am using the betfair c# program i have found on the github. (Of course, I have modified it.)
    There is a file as: AppKeyAndSessionProvider.cs. I have inserted this line before the login details:

    try
    {
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    string uri = string.Format("https://{0}/api/login?username={1}&password={2}", _host, _username, _password);

    HttpWebRequest loginRequest = (HttpWebRequest)WebRequest.Create(uri);
    loginRequest.Headers.Add("X-Application", _appkey);
    loginRequest.Accept = "application/json";

    etc...

    Now the login was fine, but the BetfairClient.cs was throwing new errors, so I copy-pasted this line one more time:

    public BetfairClient(string appKey, Action preNetworkRequest = null, WebProxy proxy = null)
    {
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    if (string.IsNullOrWhiteSpace(appKey)) throw new ArgumentException("appKey");

    this.appKey = appKey;
    this.preNetworkRequest = preNetworkRequest;
    this.proxy = proxy;
    }

    etc...

    End that's it. Works like a charm.
    Not the most precise solution, but I hope it can help you.

    Leave a comment:


  • AlexX
    replied
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

    Does not work need help

    Leave a comment:


  • zeal
    replied
    Hi Thurfe!

    Thank you for your answer! It works.

    Leave a comment:


  • Thurfe
    replied
    My bots also failed to login today via the api on their windows 2008 server machine, but they would run on my win 10 dev machine.

    I found the information above on what had changed to be particularly opaque, as I suspect very few bot authors would be explicitly choosing TLS ciphers.
    I could log in to the betfair website on the same machine so concluded it was some config level thing rather than an installation level issue.
    After some reading on TLS and default version behaviours on various operating system versions, I tried setting the TLS version in my code to 1.2 (rather than the default), and this seems to have resolved my problem, for now at least.

    My fix, in C#, was simply: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

    Leave a comment:

Working...
X