Skip to content

Dummy file to be able to build on FreeBSD #12

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

slegrand45
Copy link

Hi,

Without this dummy "truststore_freebsd.go" file, i get these errors if i try a build on FreeBSD 14.3 / Go 1.21.13:

./cert.go:143:16: ca.installPlatform undefined (type *CA has no field or method installPlatform)
./cert.go:156:105: undefined: NSSBrowsers
./cert.go:157:13: undefined: CertutilInstallHelp
./cert.go:158:89: undefined: NSSBrowsers
./cert.go:160:126: undefined: NSSBrowsers
./cert.go:161:81: undefined: CertutilInstallHelp
./cert.go:172:102: undefined: NSSBrowsers
./cert.go:174:13: undefined: CertutilInstallHelp
./cert.go:175:157: undefined: NSSBrowsers
./cert.go:176:89: undefined: CertutilInstallHelp
./cert.go:176:89: too many errors

After adding this file, the build is ok and i am able to build symfony-cli. So i can install API Platform as described here : Getting Started With API Platform with Symfony

I guess this is really a workaround but, at least, i'm now able to use symfony-cli on FreeBSD 🙂

Copy link
Member

@tucksaun tucksaun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for initiating this.

FreeBSD and Linux support might be relatively close in term of support so we should be able to extract part of truststore_linux.go to truststore_posix.go and make truststore_posix built for linux and freebsd.
@fabpot WDYT?

os.Getenv("HOME") + "/.mozilla/firefox-trunk/*"}
NSSBrowsers = "Firefox and/or Chrome/Chromium"

CertutilInstallHelp string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a while since I used FreeBSD (and never as a desktop) but I think it has NSS support (at least I find it in FreshPorts). In such case we should try to mimic linux support and update this with the appropriate NSS install command.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it can help, the FreeBSD NSS port installs all these files: pkg-plist

Comment on lines +19 to +21
func (ca *CA) installPlatform() error {
return nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

installing a custom certificate on FreeBSD seems to be done /usr/local/etc/ssl/cert/ and then run certctl rehash

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no /usr/local/etc/ssl/cert/ on a FreeBSD default installation. But if you install the ca_root_nss port, you get the following files:

/etc/ssl/cert.pem
/usr/local/etc/ssl/cert.pem.sample
/usr/local/openssl/cert.pem
/usr/local/share/certs/ca-root-nss.crt
/usr/local/share/licenses/ca_root_nss-3.108/LICENSE
/usr/local/share/licenses/ca_root_nss-3.108/MPL20
/usr/local/share/licenses/ca_root_nss-3.108/catalog.mk

@slegrand45
Copy link
Author

Hi,

Thank you for your comments. FWIW:

  • The utility certctl is included in the FreeBSD default installation: source

  • On a FreeBSD default installation, with no ports installed (other than Go), the command symfony-cli server:ca:install succeeds:

You might have to enter your root password to install the local Certificate Authority certificate
The local CA is now installed in the system trust store!
Generating a default certificate for HTTPS support                
 [OK] The local Certificate Authority is installed and trusted

and it creates the following files in my home directory:

/home/stephane/.symfony5/certs/rootCA-key.pem
/home/stephane/.symfony5/certs/rootCA.pem
/home/stephane/.symfony5/certs/trusted
/home/stephane/.symfony5/certs/default.p12

If i can do other tests, feel free to ask. My mid-term goal, ideally, would be to add symfony-cli to the FreeBSD ports tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants