Exception - SSL Handshake failed in SimpleFileAccess

Creating a macro - Writing a Script - Using the API

Exception - SSL Handshake failed in SimpleFileAccess

Postby nrtm5993 » Fri Jul 20, 2018 11:04 am

Code: Select all   Expand viewCollapse view
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
nrtm5993
 
Posts: 7
Joined: Fri Jul 20, 2018 10:41 am
Location: Japan

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby MrProgrammer » Sun Jul 22, 2018 10:29 pm

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.5 Build 9789 on MacOS 10.11.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Moderator
 
Posts: 3838
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby nrtm5993 » Mon Jul 23, 2018 12:27 am

Thank you for your reply
I am not familiar with the service

NG
https://www.traders.co.jp/

OK
https://www.yahoo.com/

Both are HTTPS
why? What is the difference?

Please tell me if you have other suitable services
LibreOffice5.4.7.2,LibreOffice Basic, Windows7
nrtm5993
 
Posts: 7
Joined: Fri Jul 20, 2018 10:41 am
Location: Japan

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby Bidouille » Mon Jul 23, 2018 10:56 am

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
User avatar
Bidouille
Volunteer
 
Posts: 285
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby nrtm5993 » Mon Jul 23, 2018 12:51 pm

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

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby robleyd » Mon Jul 23, 2018 2:13 pm

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
Apache OpenOffice Developer Build 4.2.0 9820 - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 2984
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby nrtm5993 » Mon Jul 23, 2018 2:41 pm

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

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby UnklDonald418 » Mon Jul 23, 2018 4:33 pm

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.6 & LibreOffice 6.1.5.2 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 1224
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby nrtm5993 » Mon Jul 23, 2018 5:08 pm

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

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby RoryOF » Mon Jul 23, 2018 5:23 pm

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.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29560
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby Bidouille » Mon Jul 23, 2018 6:21 pm

nrtm5993 wrote:The same error occurs in calc (External Data)

Not reproduce with AOO 4.1.4:
Image
User avatar
Bidouille
Volunteer
 
Posts: 285
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby nrtm5993 » Mon Jul 23, 2018 7:43 pm

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

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby Bidouille » Thu Jul 26, 2018 10:25 am

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.
User avatar
Bidouille
Volunteer
 
Posts: 285
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby nrtm5993 » Thu Jul 26, 2018 1:25 pm

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

Re: Exception - SSL Handshake failed in SimpleFileAccess

Postby binba » Wed Sep 11, 2019 9:42 pm

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
binba
 
Posts: 2
Joined: Sat Dec 12, 2009 1:24 am


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 7 guests