sterrenb / flutterhole

A third party Android application for the Pi-Hole® dashboard.
https://play.google.com/store/apps/details?id=sterrenburg.github.flutterhole
MIT License
400 stars 27 forks source link

TLSV1_UNRECOGNIZED_NAME(tls_record.cc:587) #115

Closed aljazzair closed 3 years ago

aljazzair commented 4 years ago

Describe the bug

Hello and thank you for creating this application.

I cannot display dashboard for standard PiHole installation using FlutterHole over HTTPS with correct self signed certificates, using proper API credentials. Tried to turn the "allow self signed certificates" option to no avail.

The same dashboard is accessible on any browser from the same device on the same network pointing to the same https URL.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://10.11.11.10'
  2. Tap on 'Dashboard'
  3. See error

Expected behavior Ability to access pihole dashboard over https

Error Message


Alice - HTTP Inspector
App name:  flutterhole
Package: sterrenburg.github.flutterhole
Version: v5.2.3
Build number: 641
Generated: 2020-08-29T11:57:54.150541

===========================================
Id: 681511586
============================================
--------------------------------------------
General data
--------------------------------------------
Server: 10.11.11.10
Method: GET
Endpoint: /admin/
Client: Dio
Duration 775 ms
Secured connection: true
Completed: true
--------------------------------------------
Request
--------------------------------------------
Request time: 2020-08-29 11:54:39.691907
Request content type: application/json; charset=utf-8
Request cookies: []
Request headers: {
"user-agent": "flutterhole"
}
Request size: 0 B
Request body: Body is empty
--------------------------------------------
Response
--------------------------------------------
Response time: 2020-08-29 11:54:40.466752
Response status: -1
Response size: 0 B
Response headers: null
Response body: Body is empty
--------------------------------------------
Error
--------------------------------------------
Error: DioError [DioErrorType.DEFAULT]: HandshakeException: Handshake error in client (OS Error:
TLSV1_UNRECOGNIZED_NAME(tls_record.cc:587))
--------------------------------------------
Curl
--------------------------------------------
curl -X GET -H 'user-agent: flutterhole' 'https://10.11.11.10/admin/'
==============================================

Versions (please complete the following information):

Additional context This is over VPN. Certificates created using pfsense. Works everywhere else with no issues. I believe this is related to issue #84 possibly a duplicate?

sterrenb commented 3 years ago

Hello @aljazzair 👋 - Thanks for opening an issue!

The error (TLSV1_UNRECOGNIZED_NAME) seems indeed similar to the issue you referenced.

I will take a look at the SSL implementation of the app again (this tiny snippet).

As an idea, have you tried turning on the allowSelfSigned toggle, then kill the app, then restart it? Perhaps the app's client instance is not updated correctly in the linked snippet.

aljazzair commented 3 years ago

Hello

Thank you very much for taking the time to review and answer. I did follow your advice and it works. I am now able to open the application and view the dashboard on both my android devices :) I am now closing this issue.