Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme get command fails with: x509: certificate signed by unknown authority #544

Closed
IOIIOOIO opened this issue Aug 22, 2018 · 25 comments
Closed
Labels
🚢 pending next release This is fixed but has not been released yet. This issue will be closed upon next release.
Milestone

Comments

@IOIIOOIO
Copy link

IOIIOOIO commented Aug 22, 2018

I tried following the Getting Started documentation but when I run the theme get command it fails with the error message: x509: certificate signed by unknown authority and appears to be referencing the meta.json file

It's worth noting that this is an existing app that I'm taking over from another developer.

My Environment

OS : MacOS High Sierra
Themekit version: v.0.8.0

@tanema
Copy link
Contributor

tanema commented Aug 22, 2018

If you go to the shops domain in your browser like this: https://[shop-name].myshopify.com/meta.json does that succeed? Or do you get a certificate warning?

[Edit]: BTW the meta.json request is just the shop info request. It helps validate that you are indeed requesting a valid shop domain and that the shop is no frozen or shut down.

@IOIIOOIO
Copy link
Author

Yes it succeeds

@tanema
Copy link
Contributor

tanema commented Aug 22, 2018

Hmm okay, it may have something to do with your keychain access settings. I don't know too much about it so I will get back to you when I can investigate it.

@tanema
Copy link
Contributor

tanema commented Aug 22, 2018

By any chance are you using a proxy in your config or in general?

@IOIIOOIO
Copy link
Author

IOIIOOIO commented Aug 22, 2018

Sorry I'm not sure what config you're referring to?

This is a shop that is halfway through development, and I've taken over. And I've never worked on a Shopify app before. I want to be able to work on it from my local. I saw that they named the app "Theme Kit" so I figured that's what they were using.

@tanema
Copy link
Contributor

tanema commented Aug 22, 2018

Oh you need to make sure they are using themekit or Slate they handle your projects in different ways. If your theme looks like this: https://github.com/Shopify/skeleton-theme they were probably using Slate.

If however you are using themekit, then there should be a config.yml in the root directory of your project.

@IOIIOOIO
Copy link
Author

Ok, I don't see any config file. It also doesn't look like it was done with Slate.

What's interesting to note is I don't seem to have any issues when getting it on my Windows machine...

@tanema
Copy link
Contributor

tanema commented Aug 22, 2018

Okay did you inherit a repo or just the shopify files? If just from shopify, you are getting files from shopify using theme get -t=[theme_id] -s=[store] -p=[password]?

@IOIIOOIO
Copy link
Author

Yes there's no repo for this. I've just taken over the store in Shopify.

When I run theme get -t=[theme_id] -s=[store] -p=[password] on my MacBook then I get the certificate error.

When I run the same command on my Windows PC everything works fine.

@tanema
Copy link
Contributor

tanema commented Aug 22, 2018

When I run the same command on my Windows PC everything works fine.

Okay, that indicate that there is something silly with your KeyChain Access. Okay I will have too look into that. Thank you for you help.

@IOIIOOIO
Copy link
Author

Ok no problem. Look if it's a big mission for you to help me then don't worry about it. I can work from my Windows machine... it's not ideal but it will do fine.

@tanema
Copy link
Contributor

tanema commented Sep 14, 2018

Okay it seems like this can happen when there are duplicate and untrusted keys in your keychain access.

You can actually see this play out in an issue with Go golang/go#24147

From that issue, I don't have many ways forward with this. I would recommend opening your keychain access and removing any invalid system and root keys and then trying again.

@tanema
Copy link
Contributor

tanema commented Sep 14, 2018

I have also just migrated to Go 1.11 which it seems the go developers have tried to mitigate issues like yours. Please try it out but running theme update --verison=v.0.8.1-prerelease

@tanema tanema added this to the v1.0.0 milestone Sep 18, 2018
@sdn90
Copy link

sdn90 commented Oct 4, 2018

I temporarily had this problem which broke all commands that made HTTP requests. I fixed it by opening up a new terminal. I have no idea why that worked.

@tanema
Copy link
Contributor

tanema commented Nov 5, 2018

@IOIIOOIO Did your problem disappear after a restart as has been reported? Because as far as my research has gotten me, it looks like this would most likely be an operating system issue.

@Aeon

This comment has been minimized.

@Aeon
Copy link

Aeon commented Dec 29, 2018

Poking around the repositories, I am pretty sure the issue is golang/go#24652 (resolved in go 1.12) / golang/go#26039 (backport to 1.11, still not released)

As homebrew go version is 1.11, not 1.12, the issue is still present for me...

For now I was able to work around it by doing the following steps:

  1. run openssl s_client -connect my-store.myshopify.com:443 and see what certs are used. Check Keychain for presence of the certificates listed. DigiCert SHA2 High Assurance Server CA seems to be missing on my machine.
  2. download the DigiCert SHA2 High Assurance Server CA from DigiCert site
  3. open Keychain Access and drag the downloaded certificate into login keychain
  4. right-click the certificate, expand "Trust" section, and mark it as "Always Trust"

After that, everything seems to work so far...

@tanema
Copy link
Contributor

tanema commented Jan 2, 2019

Hey @Aeon thanks for the deep dive!

Regarding the panic, that should be handled better (and my development path in the trace is just a characteristic of Go) but the reason that was happening to you is that you were trying to update to v.0.8.2-prerelease the problem is that you have an extra period between the v and 0. This caused a panic because that is an invalid semver version. I can add an appropriate error for that.

Regarding the certificate issue, thank you for posting a solution that worked for you, thank you for doing the research, I was aware of those issues while looking into this issue but couldn't say for sure if that was the issue. I don't think I know enough about SSL to understand why you would be missing a certificate on your machine. I will try to talk some people will the experience to figure that out, but identifying that you were actually missing a cert could be a critical bit of information, so thank you so much!

If someone else has this issue as well, please try out a version without CGO by running theme update --version=v1.0.0-issue544 and check to see if it was fixed.

@tanema tanema added the 🚢 pending next release This is fixed but has not been released yet. This issue will be closed upon next release. label Mar 20, 2019
@tanema
Copy link
Contributor

tanema commented Mar 20, 2019

Okay I have updated to a fixed version of Go as well as disabled CGO in themekit. This will be fixed in the v1.0.1 release

@tanema
Copy link
Contributor

tanema commented Jun 19, 2019

This should be fixed in 1.0.1 If you still experience it happening please reopen

@tanema tanema closed this as completed Jun 19, 2019
@MartijnOost
Copy link

I have this same issue

theme get --list -p=[password] -s=groven.myshopify.com
request failed after 5 retries with error: Get https://groven.myshopify.com/meta.json: x509: certificate signed by unknown authority

openssl s_client -showcerts -connect groven.myshopify.com:443
Verify return code: 0 (ok)

theme version
ThemeKit 1.1.4 darwin/amd64

MacOS Big Sur
Version 11.1

@FedericoCapaldo
Copy link

@MartijnOost any update on how you solved this issue?

@MartijnOost
Copy link

I didnt... Moved on to bigger and better problems. :-(

@gao0923
Copy link

gao0923 commented Mar 8, 2023

@MartijnOost, did you fix the above issue?

@MartijnOost
Copy link

Nope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚢 pending next release This is fixed but has not been released yet. This issue will be closed upon next release.
Projects
None yet
Development

No branches or pull requests

7 participants