Issue 127680 - webdav https client certificate .p12
Summary: webdav https client certificate .p12
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: Writer
Classification: Application
Component: save-export (show other issues)
Version: 4.1.5
Hardware: All All
: P5 (lowest) Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-30 15:33 UTC by ced
Modified: 2019-07-22 13:37 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ced 2018-01-30 15:33:30 UTC
Hello,

I set up a WebDav Server on ubuntu 16.04 with apache 2.4.18 and created a folder  to store documents with a Macro like this:

Sub SaveFile

Dim Doc As Object
	Dim	Url As	String
	Dim FileProp(0) As New com.sun.star.beans.PropertyValue
	Url = "https://192.168.147.128/webdav/test.sxw"
	Url = ConvertToUrl(Url)
	FileProp(0).Name = "Overwrite"
	FileProp(0).Value = True
	Doc = Stardesktop.CurrentComponent
	Doc.storeAsURL(Url, FileProp())
End Sub

I Also set up webdav folder to require a certificate from the client but this works perfectly only for browsers and not with openoffice that will crash-

Also i would like to know if it's possible to embed the username / password  in the url(works with ftp)  like this or n any other way

Url = "https://username:password@192.168.147.128/webdav/test.sxw" bu it seems not supported


Thanks in Advance
Comment 1 oooforum (fr) 2018-02-11 18:03:08 UTC
Why saving in SXW? This format is outdated.
Use ODT and test if the problem still occurs.
Comment 2 ced 2018-02-12 09:39:06 UTC
Thank you for the reply , i know it's outdated but that's not the problem.
The Issue is how macro handles the saving trough https/webdav , Anyway i tried but it doesnt work.

I found a way for handling authentication with 
"com.sun.star.task.XInteractionHandler2" and "com.sun.star.ucb.URLAuthenticationRequest"

see https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=66160


Sub SaveFile

Dim Doc As Object
	Dim	Url As	String
        Dim oihandler 
    oihandler = CreateUnoListener("InteractionHandler_", "com.sun.star.task.XInteractionHandler2")
	Dim FileProp(1) As New com.sun.star.beans.PropertyValue     

	Url = "https://192.168.147.128/webdav/test.sxw"
	Url = ConvertToUrl(Url)
	FileProp(0).Name = "Overwrite"
	FileProp(0).Value = True
        FileProp(1).Name = "InteractionHandler"
        FileProp(1).Value = oihandler
	Doc = Stardesktop.CurrentComponent
	Doc.storeAsURL(Url, FileProp())
End Sub



Sub InteractionHandler_handle(req)
  r = req.getRequest()
  If CheckExceptionType(r, "com.sun.star.ucb.URLAuthenticationRequest") Then
    conts = req.getContinuations()   
    for i = 0 to ubound(conts) step 1
      cont = conts(i)
      If HasUnoInterfaces(cont, "com.sun.star.ucb.XInteractionSupplyAuthentication") Then	   
        cont.setUserName("username")     
        cont.setPassword(InputVal)
        cont.select()
      	Exit For    	 
      End If
    Next i  	
  End If
End Sub


So the problem here is to understand if i can use a certificate for client Authentication combined with the password supplied by the the user.

Is there any exhaustive documentation on this interfaces ?
Comment 3 oooforum (fr) 2019-02-10 19:10:45 UTC
Did you have an error when you save directly with File > Save as menu?
Comment 4 oooforum (fr) 2019-07-22 12:48:04 UTC
No news from OP since +1 yr.