Page 1 of 1

Exception - SSL Handshake failed in SimpleFileAccess

Posted: Fri Jul 20, 2018 11:04 am
by nrtm5993

Code: Select all

strURL = "https://www.traders.co.jp/" 
oSimpleFileAccess = createUNOService ("com.sun.star.ucb.SimpleFileAccess")
oInpDataStream = createUNOService ("com.sun.star.io.TextInputStream")
oInpDataStream.setInputStream(oSimpleFileAccess.openFileRead(strURL))
Exception => oSimpleFileAccess.openFileRead(strURL)
Type:com.sun.star.ucb.InteractiveNetworkReadException
Message:SSL handshake failed: Secure connection truncated.
Can anyone solve this problem?

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Sun Jul 22, 2018 10:29 pm
by MrProgrammer
Hi, and welcome to the forum.
nrtm5993 wrote:strURL = "https://www.traders.co.jp/"
oSimpleFileAccess = createUNOService ("com.sun.star.ucb.SimpleFileAccess")
Message:SSL handshake failed: Secure connection truncated.
OpenOffice API wrote:service SimpleFileAccess
Description: Offers a simple access to resources, like files and folders located in a local file system or on a WebDAV server.
What evidence do you have that SimpleFileAccess is an appropriate service to use with the HTTPS protocol?

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Mon Jul 23, 2018 12:27 am
by nrtm5993
Thank you for your reply
I am not familiar with the service

NG
OK
Both are HTTPS
why? What is the difference?

Please tell me if you have other suitable services

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Mon Jul 23, 2018 10:56 am
by Bidouille
nrtm5993 wrote:Please tell me if you have other suitable services
No need macro, use Calc directly:
https://wiki.openoffice.org/wiki/Docume ... ernal_data

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Mon Jul 23, 2018 12:51 pm
by nrtm5993
Thank you for your reply

The same error occurs in calc (External Data)
Error reading data from the Internet
Server error message:SSL handshake failed:Secure connection truncated.

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Mon Jul 23, 2018 2:13 pm
by robleyd
For me, attempting to open https://www.traders.co.jp in a web browser results in

Secure Connection Failed

The connection to www.traders.co.jp was interrupted while the page was loading.
  • The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
    Please contact the website owners to inform them of this problem.
The problem may not lie with AOO. Try searching the error message "SSL handshake failed:Secure connection truncated." via your preferred search tool - Google, Bing, etc.

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Mon Jul 23, 2018 2:41 pm
by nrtm5993
Thank you for your reply

I can access it normally with my browser
-google chrome 67.0.3396.99
-InternetExplorer11.0.9600.19080
-FireFox 46.0.1

I think that perhaps SSL rules are affecting
It seems that you can not access because SSL rules are old in old browser

This problem could not be solved by Google
I am probably thinking about the possibility that LIBREOFFICE does not correspond to the new SSL rule
I may be wrong because I am not familiar with SSL

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Mon Jul 23, 2018 4:33 pm
by UnklDonald418
I can access it normally with my browser
-google chrome 67.0.3396.99
-InternetExplorer11.0.9600.19080
-FireFox 46.0.1
Web browsers are designed to recognize and negotiate an encryption key with the transmitting site.
Look at HTTPS on Wikipedia for a more detailed description of the process.
createUNOService ("com.sun.star.ucb.SimpleFileAccess") does none of that.

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Mon Jul 23, 2018 5:08 pm
by nrtm5993
Thank you for your reply

Do not you know any other solutions?
I want to know other ways to access this site
I would like to know the code of LibreOffice Basic.

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Mon Jul 23, 2018 5:23 pm
by RoryOF
It may be (I do not know for certain) that writing your code in Python will allow you use more powerful libraries, which offer the facility you need.

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Mon Jul 23, 2018 6:21 pm
by Bidouille
nrtm5993 wrote:The same error occurs in calc (External Data)
Not reproduce with AOO 4.1.4:
Image

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Mon Jul 23, 2018 7:43 pm
by nrtm5993
I was surprised!

I also tried it with OpenOffice.org
I also confirmed that it worked normally
my ver:OpenOffice.org3.4.0

Is it a bug in LIbreOffice?
PC environment or configuration problems?

I will add further
Exception did not occur in SimpleFileAccess
But the return was empty

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Thu Jul 26, 2018 10:25 am
by Bidouille
nrtm5993 wrote:Is it a bug in LIbreOffice?
PC environment or configuration problems?
Maybe if other users with same LibO build can confirmed.
But this forum is not the right place for the issue. It needs a bug report to the developers.
Remember too that 5.4.7 is end-of-life status.

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Thu Jul 26, 2018 1:25 pm
by nrtm5993
I installed the latest version of LIbreOffice
(ver 6.0.5.2)
The problem was not solved. The same error occurred.

By the way, an error which can not be understood even by the code of python occurred.
Library: urllib.request

I give up.
Although the procedure is unknown, I will try to report a bug to the developer.

I appreciate all the answers.

Re: Exception - SSL Handshake failed in SimpleFileAccess

Posted: Wed Sep 11, 2019 9:42 pm
by binba
MrProgrammer wrote:What evidence do you have that SimpleFileAccess is an appropriate service to use with the HTTPS protocol?
That is an odd thing to say. How about the fact that OOO uses it in its own "Link to External Data" feature?

HTTPS is the backbone of the internet now, not some special sauce. We need it to work, and add the ability to handle certificate exceptions and whatnot.

From my testing (OS X 64bit 10.3.5), OOOC 4.1.5 and 4.1.6 still have this issue. In LibreOffice 6.3.1.2 the same methods work as long as the SSL is clean.

Also see this thread, SimpleFileAccess fails with HTTP link.

BTW, where does the documentation list the protocols that are supported (including HTTP)? I can't see any mentioning of any protocols, except "file://" and the fact the "URL" is a convention most often used with HTTP/S.