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

specify minimum tls version #94

Merged
merged 5 commits into from
Aug 15, 2024
Merged

Conversation

Freyert
Copy link
Contributor

@Freyert Freyert commented Jun 28, 2024

I kept receiving 403s from https://fs.blog/feed/ . It turns out that it's probably because cloudflare blocks you unless you specify a minimum TLS version.

TLS 1.3 might be too high, but it solved my problem.

@guyfedwards
Copy link
Owner

Thanks for the contribution @Freyert. I think we should have the tls version be configurable as 1.2 is still supported. I suggest adding a minTLSVersion field to config.Feed which can then be used in Fetch.

@Freyert
Copy link
Contributor Author

Freyert commented Jul 3, 2024

@guyfedwards agreed! I'll work it in this weekend.

@@ -138,6 +143,13 @@ func (c *Config) Load() error {
c.Feeds = fileConfig.Feeds
c.Openers = fileConfig.Openers

if fileConfig.HTTPOptions != nil {
if _, err := TLSVersion(fileConfig.HTTPOptions.MinTLSVersion); err != nil {
return err
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't seem to work as expected. I get unhelpful output like this if I set it to some unsupported string:

flax% go run cmd/nom/main.go
Usage:
  main [OPTIONS]

Application Options:
  -v, --verbose      Show verbose logging
  -n, --number=      Number of results to show
  -p, --pager=       Pager to use for longer output. Set to false for no pager
      --config-path= Location of config.yml
  -f, --feed=        Feed(s) URL(s) for preview
      --version      Display version information

Help Options:
  -h, --help         Show this help message
exit status 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What I would expect is to see a "config error" message and exit status 1.

Copy link
Owner

Choose a reason for hiding this comment

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

if you run go run cmd/nom/main.go -v do you see the error? This is a gotcha with the --verbose flag showing errors. Needs to be refactored out at some point

@guyfedwards
Copy link
Owner

@Freyert are you happy with this? Looks good to me

@guyfedwards
Copy link
Owner

ping @Freyert

@Freyert
Copy link
Contributor Author

Freyert commented Aug 15, 2024

👍 it's good for me.

@guyfedwards guyfedwards merged commit 6263b22 into guyfedwards:master Aug 15, 2024
2 checks passed
@guyfedwards
Copy link
Owner

Thanks @Freyert

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

Successfully merging this pull request may close these issues.

2 participants