Open marcio199226 opened 1 year ago
What JS code are you using to call the API? Is there a reason you want to make these API calls from JS rather than Go? I'd call a bound Go method to go get the data rather than rely on webview implementations as it'll be far more flexible and likely to work everywhere.
It's simply a http lib from angular
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';
@Injectable({ providedIn: 'root' })
export class AuthApi {
constructor(private http: HttpClient) { }
signin(payload: any): Observable<any> {
return this.http.post(`${environment.ApiBaseUrl}/auth/login`, payload);
}
singup(payload: any): Observable<any> {
return this.http.post(`${environment.ApiBaseUrl}/registration`, payload);
}
}
Is there a reason you want to make these API calls from JS rather than Go Yeah I want to treat the fe part as normal SPA that makes api related stuff is more straightforward in ts than in golang. I want to use the be part only for rsa management, encrypt/decrypt of messages, do gpg file encryption and so on...
Anyway on MacOs and Windows it works calling straight my server or even passing through golang reverse proxy, it even work launching *.exe from wine.
If you trust me or you have some vm with some newer debian distro that mine maybe you can try if it works, simply open the app e try to login with any credentials you want then check by inspector if the api responds correctly or there is an error. mchat-desktop.zip
Maybe its somehow related to ubuntu 18.04...?!?
P.S
I'd call a bound Go method to go get the data rather than rely on webview implementations as it'll be far more flexible and likely to work everywhere.
Please note that it even doesn't work with golang proxy, so I'm quite sure that's related to ubuntu 18.04 or some "old" dependecies (webkitgtk related stuff ?) or the webview itself on ubuntu ? What's the repository of webview implementations for unix like systems ? maybe I can search if there are any issues related to TLS errors
@marcio199226
Please can you retry using the latest version. Remember to upgrade the version of Wails in you project's go.mod
.
Unfortunately I have the same issue on v2.5.0 and v2.5.1 :(
Wails CLI v2.5.1
SUCCESS Done.
# System
OS | Ubuntu
Version | 18.04
ID | ubuntu
Go Version | go1.20.2
Platform | linux
Architecture | amd64
# Wails
Version | v2.5.1
Package Manager | apt
# Dependencies
Dependency | Package Name | Status | Version
*docker | docker.io | Installed | 23.0.6
gcc | build-essential | Installed | 12.4ubuntu1
libgtk-3 | libgtk-3-dev | Installed | 3.22.30-1ubuntu4
libwebkit | libwebkit2gtk-4.0-dev | Installed | 2.32.4-0ubuntu0.18.04.1
npm | npm | Installed | 6.14.17
*nsis | nsis | Installed | v2.51-1
pkg-config | pkg-config | Installed | 0.29.1-0ubuntu2
* - Optional Dependency
# Diagnosis
Your system is ready for Wails development!
♥ If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
Description
Hi I have a backend here: https://server.mchat.ovh/ with TLS enabled and the certificates generated by lets encrypt certbot. When I running my app with wails dev everything goes ok, when running builded app I encounter this error message in webview console "Failed to load resource: WebKit encountered an internal error"
I think that the problem is caused by Origin header that in case of wails dev it's set to localhost:34115 and in case of wails build it's set to wails://wails and this custom protocol cause some troubles.
I can't figure out how can I fix it. I even tried some local http proxy like this:
But I still encounter the same error. I thought that the problem is only with self signed tls certificates but it's not working even with certs coming from lets encrypt. You can verify that the certs is working properly on https://server.mchat.ovh/ because the browser do not ask if you would to proceed to visit site with self signed cert. It's even work with curl or postman with ssl verification.
To Reproduce
I don't know how to provide steps to reproduce. I can give you an access to my repo or provide you a builded version if needed
Expected behaviour
I should can call external api without any troubles Tried on MacOs 12.6.x with M1 and it works for both wails build and wails dev calling directly https://server.mchat.ovh and http://localhost:8080 so it's definitely a problem on unix
p.s I have tried to build for windows/amd64 platform and run it through wine and unexpectedly it works there are no errors related to TLS
Screenshots
Attempted Fixes
No response
System Details