Platforms to show: All Mac Windows Linux Cross-Platform

/CURL/CURLS SSL verification/CURLS SSL verification


Required plugins for this example: MBS CURL Plugin, MBS MacOSX Plugin, MBS Images Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /CURL/CURLS SSL verification/CURLS SSL verification

This example is the version from Thu, 6th Apr 2016.

Project "CURLS SSL verification.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() DoDownload End EventHandler
End Control
Control Canvas1 Inherits Canvas
ControlInstance Canvas1 Inherits Canvas
End Control
Control URL Inherits TextField
ControlInstance URL Inherits TextField
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control ResultText Inherits Label
ControlInstance ResultText Inherits Label
End Control
Private Sub DoDownload() dim cacert as FolderItem = findFile("cacert.pem") dim e as integer dim d as new CURLSMBS // collect data, so we don't need our own subclass with events d.CollectOutputData = true d.OptionSSLVerifyHost = 2 // verify server d.OptionSSLVerifyPeer = 1 // proofs certificate is authentic d.OptionURL=url.text d.OptionCAInfo = cacert.UnixpathMBS e=d.Perform // pick image from output data Canvas1.Backdrop = JPEGStringToPictureMBS(d.OutputData, true) // from JPEG plugin ResultText.text="Result: "+str(e) End Sub
Function FindFile(name as string) As FolderItem // Look for file in parent folders from executable on dim parent as FolderItem = app.ExecutableFile.Parent while parent<>Nil dim file as FolderItem = parent.Child(name) if file<>Nil and file.Exists then Return file end if parent = parent.Parent wend End Function
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project

See also:

The items on this page are in the following plugins: MBS CURL Plugin.


The biggest plugin in space...