msasikanth / twine

Twine: A multiplatform RSS reader built using Kotlin and Compose
Apache License 2.0
1.7k stars 70 forks source link

Unable to add non-HTTPS Feed #493

Open bearbattle opened 5 months ago

bearbattle commented 5 months ago

Describe the bug

I am hosting a self-managed RSS feed with no HTTPS certifacate. The Twine app seems unable to add RSS Feed with HTTP Protocol.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Add feed'
  2. Type in a HTTP RSS feed
  3. Get error: Hostname not verified or Unable to Parse TLS Header

Device Information

bearbattle commented 5 months ago

The RSS Feed is build on a shared machine where another HTTPS Certificate is applied.

I use my own HTTP version with domain foo.com where the certificate is issued with bar.com.

I create a CNAME record to bar.com. But the Twine app recognize the HTTP protocol with HTTPS certificate, which confuses me a lot, and then come up with Hostname not verified error with the certificate of bar.com.

vanniktech commented 5 months ago

@msasikanth I allow http on my reader on both Android & iOS. I even tweak the okhttp configuration to allow everything:

OkHttp.create {
    val sslContext = SSLContext.getInstance("SSL")
    //noinspection AndroidLintCustomX509TrustManager
    val trustAllCertificates = object : X509TrustManager {
      override fun checkClientTrusted(chain: Array<out X509Certificate>?, authType: String?) = Unit
      override fun checkServerTrusted(chain: Array<out X509Certificate>?, authType: String?) = Unit
      override fun getAcceptedIssuers() = emptyArray<X509Certificate>()
    }
    sslContext.init(null, arrayOf(trustAllCertificates), SecureRandom())

    this.preconfigured = OkHttpClient.Builder()
      .sslSocketFactory(sslContext.socketFactory, trustAllCertificates)
}
rutwikhdev commented 5 months ago

Some of the popular rss feeds are still on http like, Paul Graham's essays @msasikanth it would be nice if we could add feeds from non-https domains. No pressure tho, just wanna tell you I love this app, the UX is amazing and it's hard to go back using feeder after using this. Great work!