1

I am using HTTP with ASNetworkImageNode to load the image normally and now replace it with HTTPS, my HTTPS is using a self-signed certificate.

Using ASNetworkImageNode it can not load.

I was wondering how to configure the normal loading of my photos.

Patrick
  • 5,526
  • 14
  • 64
  • 101
cd_chen
  • 11
  • 2
  • Not sure its related with ASNetworkImageNode about. Do you try load that image by urself https with NSURLSession? Its looks like your configure App Transport Security (ATS) is wrong. – Bimawa Sep 06 '17 at 17:32
  • I can use SDWebimage to load pictures. In my project ASNetworkImageNode can meet my current needs, so I do not know how to configure ASNetworkImageNode configure App Transport Security (ATS) – cd_chen Sep 07 '17 at 02:15
  • Is SDWebimage work fine with your cert? Or maybe you can share simple project? – Bimawa Sep 08 '17 at 09:35
  • Please describe what happens when "it can not load". Are there any errors or how is the current behavior changed after switching to HTTPS? – Eugene Berdnikov Sep 09 '17 at 01:19
  • I can use SDWebimage to load the https format image, I would like to be asyncdisplaykit using the https self-signed certificate – cd_chen Sep 09 '17 at 11:12
  • Can you show your construct of `ASNetworkImageNode`? – Bimawa Sep 26 '17 at 16:26

1 Answers1

1

you can try the following code snippet for loading image from a url using ASNetworkImageNode

fileprivate var imageNode : ASNetworkImageNode = ASNetworkImageNode()
fileprivate var imageUrl = "your image url" // you can put your image url here.

addSubnode(imageNode) // adding the node to the parent node.

imageNode.url = URL.init(string: imageUrl!)
imageNode.contentMode = UIViewContentMode.scaleAspectFill
imageNode.backgroundColor = UIColor.white.withAlphaComponent(0.6)
swetansh kumar
  • 475
  • 7
  • 17