Exception - SSL Handshake failed in SimpleFileAccess

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
nrtm5993
Posts: 7
Joined: Fri Jul 20, 2018 10:41 am
Location: Japan

Exception - SSL Handshake failed in SimpleFileAccess

Post 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?
LibreOffice5.4.7.2,LibreOffice Basic, Windows7
User avatar
MrProgrammer
Moderator
Posts: 4901
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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?
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
nrtm5993
Posts: 7
Joined: Fri Jul 20, 2018 10:41 am
Location: Japan

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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
LibreOffice5.4.7.2,LibreOffice Basic, Windows7
Bidouille
Volunteer
Posts: 575
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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
nrtm5993
Posts: 7
Joined: Fri Jul 20, 2018 10:41 am
Location: Japan

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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.
Attachments
ExternalDataError.png
LibreOffice5.4.7.2,LibreOffice Basic, Windows7
User avatar
robleyd
Moderator
Posts: 5079
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
nrtm5993
Posts: 7
Joined: Fri Jul 20, 2018 10:41 am
Location: Japan

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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
LibreOffice5.4.7.2,LibreOffice Basic, Windows7
UnklDonald418
Volunteer
Posts: 1546
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
nrtm5993
Posts: 7
Joined: Fri Jul 20, 2018 10:41 am
Location: Japan

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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.
LibreOffice5.4.7.2,LibreOffice Basic, Windows7
User avatar
RoryOF
Moderator
Posts: 34610
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Bidouille
Volunteer
Posts: 575
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post by Bidouille »

nrtm5993 wrote:The same error occurs in calc (External Data)
Not reproduce with AOO 4.1.4:
Image
nrtm5993
Posts: 7
Joined: Fri Jul 20, 2018 10:41 am
Location: Japan

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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
LibreOffice5.4.7.2,LibreOffice Basic, Windows7
Bidouille
Volunteer
Posts: 575
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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.
nrtm5993
Posts: 7
Joined: Fri Jul 20, 2018 10:41 am
Location: Japan

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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.
LibreOffice5.4.7.2,LibreOffice Basic, Windows7
binba
Posts: 2
Joined: Sat Dec 12, 2009 1:24 am

Re: Exception - SSL Handshake failed in SimpleFileAccess

Post 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.
NeoOffice 3.0.1 on Mac OS X PPC 10.5.8
Post Reply