Self Sign Certificate Error after Ionic (Ionic Start)


#1

Just installed Ionic 3 yesterday, and try starting a new project, under my company firewall, it gave me “Error: self signed certificate in certificate chain”.

Googled and find one solution, I don’t think it is the best, is just install “ionic@legacy”, which means downgrading ionic, doesn’t make sense right?


#2

@derekstwong Hi, it is just a matter of npm at your stage because whatever Linux or Windows is your company server, you just need to be able to run a npm server company wide (node.js). I guess your company firewall disabled it for obvious security reasons, a node server can run tons of things :confused:


#3

@FrancoisIonic Thanks for your reply, is it funny that I could download Ionic 3 via npm, but couldn’t start a new project?

I have already set npm config ssl-strict=false, that’s why I could update ionic and cordova…etc.

This happens only for Ionic…so strange…:confounded:


#4

Am I the only one that thinks this is an absolutely crazy irresponsible thing to do?


#5

At first, I couldn’t install ionic via npm, same error existed.
From npm official forum, it claimed it is “normal” to do what I did…


#6

I think that’s insane. You are basically executing completely untrusted code that you are getting from a random source on the Internet that may perfectly well be a poisoned trojan rootkit.


#7

I can’t disagree with you mate, but that’s a way for me to install ionic at this moment. Anyway, should I make request to network administrator to free “something” for me in order to setup ionic project correctly?


#8

That sort of depends on whether or not said admin is part of the problem. There are proxies that effectively MitM all of your SSL traffic, and if you’re behind one of those, and the admin thinks that’s a good thing, you’re probably best off just trying to keep a low profile.

If they aren’t so sinister, maybe you could ask them to set something up that you can config npm’s https-proxy to, preferably while batting your eyelashes and saying you’re concerned about internal network security, especially with all the ransomware floating about.


#9

Great, but so funny that I have asked the network admin about firewall configuration, he said the firewall is controlled by outside vendor. SXXT.

Perhaps I have to find one more way until there is a way to allow the HTTPS connection for Ionic.

But, it is strange that I am “allowed” to do the same thing “ionic start” for Ionic 2, but not for “@latest”.


#10

My next question would be “so why are you still here?”, but then again I get fired a lot.


#11

What I want to know is, “why Ionic2 OK but not Ionic3”


#12

I try to avoid “Ionic v2” and “Ionic v3” because of the complex nature of the versioning with the various parts of Ionic, but a cursory glance at the cli source leads me to believe that the v2 CLI fetches the list of starter templates via unsecured HTTP, whereas the v3 CLI uses HTTPS.


#13

That’s what I thought, but I remember I found once v2 CLI download via https.

Anyway, you gave me a good idea for this case.

Ionic committee will not consider HTTP but MUST HTTPS. Am I right?


#14

How you get it is different from the protocol it uses internally.

Way above my pay grade, but for all our sakes, I hope they insist on HTTPS. The npm ecosystem is fragile enough as it is.


#15

Lemme try to find more ways then, thanks a lot.


#16

There is a certificate installed to browsers (Chrome/Firefox). In order to get thru the https website.

Is there any way to import the certificate to Ionic so that I could do the same thing for “ionic start”?


#17

That’s really stange… I could do nearly all things in npm (download ionic, cordova), but failed for ionic start (downloading project packages…)

Last Updated: I tried “wget” via powershell, for the failed package.
https://github.com/driftyco/ionic2-app-base/archive/master.tar.gz

Status Code : 200, which should mean connection success…
That’s really strange that just failed in ionic start…HELP!


#18

Quick and dirty fix:
Open a hotspot with your phone, connect to it, do whatever needs done, switch back to company network.

Also tell bosses you lost x hours of work time @ $y/hour because of this crap.


#19

I’m really not sure about this, but I’d tend to say this is because of CORS policy is a lot more enforced in Ionic 3 (by dependencies) than Ionic 2, but really not sure.


#20

Such a funny case that I was failed even for “ionic docs”, same self sign certificate. Well, have to say, perhaps I have to build projects at home, or outside company network till there are solutions found.

Thanks for reply.

Thanks for CORS in ionic3…