Starting brainstorm secure connection fails

Hello,
I'm new to Brainstorm. I just activated my account, but Brainstorm won't take my email-password. It says "secure connection to the brainstsorm server failed"
Can you help me?
Many thanks!
Filipa

You have access to the forum, so your account is fully working.

"secure connection to the brainstsorm server failed"

What gives you this error?

Thank you for your reply Francois.

Indeed, I have a brainstorm account that I activated and I have access to the forum.
However, when I am in matlab and I initiate brainstorm I am requested to fill my email and password. When I do it and click enter, that is when a pop window with "could not establish a secure connection to Brainstsorm server" appears, followed by this text on matlab:

BST> Starting Brainstorm:
BST> =================================
BST> Version: 18-Aug-2021
BST> Compiling main interface files...
BST> Emptying temporary directory...
BST> Deleting old process reports...
BST> Loading configuration file...
BST> Loading default montages...
BST> Checking internet connectivity... ok
BST> Initializing user interface...


** Error: Could not establish a secure connection to Brainstorm server


I would really like to start working on my data with brainstorm but at this moment I am blocked.
If you have an idea of what the problem could be, I would really appreciate it.

Thank you so much!

Hi François,
I'm helping Filipa out here. Do you know what server address the software is trying to connect to? Perhaps our IT dept will need to allow this connection...
Many thanks,
Max

Sorry for the response delay.

For debugging, please copy-paste this in your Matlab command window, then copy-paste here the output:

header = matlab.net.http.field.ContentTypeField('application/x-www-form-urlencoded');
options = matlab.net.http.HTTPOptions();
request = matlab.net.http.RequestMessage(matlab.net.http.RequestMethod.POST, header, 'test')
resp = send(request, 'https://neuroimage.usc.edu/bst/check_user.php', options)
resp.Body.Data

In the meantime, to get it to work, simply delete the files LICENSE and README.md.
They are present on the GitHub repository but not in the package downloaded from the website, and updated automatically or with brainstorm update.

Explanation: We try to promote the download from the website instead of cloning from github, because it gives us usage statistics we can attach to our NIH grant applications...

Hi François,

This is the output we get (I get this from my computer on the domain, and I guess Filipa too).

Should we talk to our IT about it?

header = matlab.net.http.field.ContentTypeField('application/x-www-form-urlencoded');
options = matlab.net.http.HTTPOptions();
request = matlab.net.http.RequestMessage(matlab.net.http.RequestMethod.POST, header, 'test')
resp = send(request, 'https://neuroimage.usc.edu/bst/check_user.php', options)
resp.Body.Data
request = 
  RequestMessage with properties:

         Method: POST
    RequestLine: 'POST'
         Header: [1×1 matlab.net.http.field.ContentTypeField]
           Body: [1×1 matlab.net.http.MessageBody]
      Completed: 0
Error using matlab.net.http.RequestMessage/sendOneRequest (line 1269)
Could not establish a secure connection to "neuroimage.usc.edu". The reason is "error:14090086:SSL
routines:ssl3_get_server_certificate:certificate verify failed". Check your certificate file
(/usr/local/MATLAB/R2019a/sys/certificates/ca/rootcerts.pem) for expired, missing or invalid certificates.
Error in matlab.net.http.RequestMessage/send (line 484)
                    obj.sendOneRequest(connector, options, [], ...
Caused by:
    Could not establish a secure connection to "neuroimage.usc.edu". The reason is "error:14090086:SSL
    routines:ssl3_get_server_certificate:certificate verify failed". Check your certificate file
    (/usr/local/MATLAB/R2019a/sys/certificates/ca/rootcerts.pem) for expired, missing or invalid certificates.
Could not establish a secure connection to "neuroimage.usc.edu". The reason is "error:14090086:SSL
routines:ssl3_get_server_certificate:certificate verify failed". Check your certificate file
(/usr/local/MATLAB/R2019a/sys/certificates/ca/rootcerts.pem) for expired, missing or invalid certificates.
Error in matlab.net.http.internal.HTTPConnector/sendRequest (line 324)
            obj.ContentType = connection.ContentType; % may be empty if no Content-Type
Error in matlab.net.http.RequestMessage/sendOneRequest (line 1138)
                [~, history] = connector.sendRequest(credInfo, history);
Error in matlab.net.http.RequestMessage/send (line 484)
                    obj.sendOneRequest(connector, options, [], ...

This is related with this problem: https://github.com/brainstorm-tools/brainstorm3/issues/308#issuecomment-646026943

If you use a newer version of Matlab (2020a), you wouldn't get this error anymore. Older versions can't communicate overt HTTPS anymore.

Can you run the same test with HTTP instead of HTTPS?
resp = send(request, 'http://neuroimage.usc.edu/bst/check_user.php', options)

Can you update Brainstorm and try again?
https://github.com/brainstorm-tools/brainstorm3/commit/8e88491fb39fc59b562e77bbe525b46983c52a3a

>> resp = send(request, 'http://neuroimage.usc.edu/bst/check_user.php', options)
Error using matlab.net.http.RequestMessage/send (line 484)
Could not establish a secure connection to "neuroimage.usc.edu". The reason is "error:14090086:SSL
routines:ssl3_get_server_certificate:certificate verify failed". Check your certificate file
(/usr/local/MATLAB/R2019a/sys/certificates/ca/rootcerts.pem) for expired, missing or invalid certificates.
Caused by:
    Could not establish a secure connection to "neuroimage.usc.edu". The reason is "error:14090086:SSL
    routines:ssl3_get_server_certificate:certificate verify failed". Check your certificate file
    (/usr/local/MATLAB/R2019a/sys/certificates/ca/rootcerts.pem) for expired, missing or invalid certificates.
Could not establish a secure connection to "neuroimage.usc.edu". The reason is "error:14090086:SSL
routines:ssl3_get_server_certificate:certificate verify failed". Check your certificate file
(/usr/local/MATLAB/R2019a/sys/certificates/ca/rootcerts.pem) for expired, missing or invalid certificates.
Error in matlab.net.http.internal.HTTPConnector/sendRequest (line 324)
            obj.ContentType = connection.ContentType; % may be empty if no Content-Type
Error in matlab.net.http.internal.HTTPConnector/openRedirectConnection (line 794)
                [response, history] = obj.sendRequest(credInfo, history, true);
Error in matlab.net.http.internal.HTTPConnector/sendRequest (line 418)
                    [resp, history] = obj.openRedirectConnection(credInfo, history);
Error in matlab.net.http.RequestMessage/sendOneRequest (line 1138)
                [~, history] = connector.sendRequest(credInfo, history);
Error in matlab.net.http.RequestMessage/send (line 484)
                    obj.sendOneRequest(connector, options, [], ...

Ok, so this doesn't work anyway.
Can you please get this last update and make sure it displays correct error messages:
https://github.com/brainstorm-tools/brainstorm3/commit/01207daa20232c2b1e7699a2b71e58d71cdad265

Three solutions:

  • you keep pulling from github but delete LICENSE and README.md every time
  • you get Brainstorm as a .zip from the download page of the website and update it by executing "brainstorm update".
  • you update Matlab >= 2020a

Maybe this fix would solve the problem:
https://github.com/brainstorm-tools/brainstorm3/pull/441

1 Like