Search code examples
web-servicessmalltalksqueakpharo

How can I make an HTTPS request in Squeak or Pharo?


How can I make an HTTPS request from Squeak or Pharo? HTTPClient and friends seem to lack any facilities for SSL.


Solution

  • Zodiac as mentioned above will enable you to make HTTPS requests from Zinc.

    Enable it like this (recipe from the Pharo forum):

    First download the SqueakSSL plugin and put it in your Pharo directory, and then load the necessary packages:

    "Load Zinc HTTP Components"
    Gofer it 
      squeaksource: 'ZincHTTPComponents'; 
      package: 'Zinc-HTTP'; 
      package: 'Zinc-Tests'; 
      package: 'Zinc-Patch-HTTPSocket'; 
      load. 
    
    "Load Zodiac including extras"
    Gofer it 
      squeaksource: 'Zodiac'; 
      package: 'Zodiac-Core'; 
      package: 'Zodiac-Tests'; 
      load. 
    
    "Load extra Zinc support for Zodiac"
    Gofer it 
      squeaksource: 'ZincHTTPComponents'; 
      package: 'Zinc-Zodiac'; 
      load. 
    
    "Switch to the Zn Zodiac socket factory" 
    ZnNetworkingUtils default: ZnZodiacNetworkingUtils new. 
    

    And you should be able to make requests against HTTPS resources.