-
Notifications
You must be signed in to change notification settings - Fork 41
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
"Failed to verify certificate" using a local replica #594
Comments
After quite some research it seems that there is no solution and this is a bug. Pinging again as if this is true it's a big blocker for anyone that a local setup with Plug. Happy to help in any way and get pass this issue. Thread on Dfinity Forum: |
Same issue. The plug team has worked on it? |
I'm not aware yet. When plug arrived it didn't support local development so many used mainnet. As time goes on and more switch to local, this issue will become more apparent. I'm sure the plug team will pick it up soon. |
@LiveDuo Hi we have worked on this issue during this release and it should be part of version 0.6 |
Great to hear. Looking forward for the release. |
The issue applies again |
This problem is still happening |
I am also running into this bug. I have incorporated Authorization and canister calls using II, I tried adding Plug, and found that Authorization works, but when trying to make canister calls locally I get: "Error: Invalid certificate: Signature verification failed". I want to use Plug and II for my App, but this is a bit of a show stopper. |
I'll add my code in case someone has a suggestion on whether or not I may be missing something when it comes to Plug. I have the wallet extension in Developer mode, with the local network added. I get a failure with the error when making a canister call on the local network: An example of a motoko canister method that works with II, but not with Plug, looks like this: public shared func release(user: Principal) : async Types.Released {
if (Principal.equal(user, anonymous)){return false;};
custodians := List.push(user, custodians);
released := true;
return released;
}; The Method I use to Create my Plug Auth looks like this: export class IC_PlugAuth {
constructor(authButton, iface, whitelist, canisterId) {
this.is = 'INTERNET_COMPUTER_PLUG_AUTH';
this.AUTH_BUTTON = authButton;
this.CANISTER_WHITE_LIST = whitelist;
this.CANISTER_ID = canisterId;
this.INTERFACE = iface;
this.AGENT = undefined;
this.ACTOR = undefined;
this.PRINCIPAL = undefined;
}
async authenticate(){
if(this.CANISTER_WHITE_LIST.length == 0 || this.CANISTER_ID == undefined || this.INTERFACE == undefined)
return;
const whitelist = this.CANISTER_WHITE_LIST;
const onConnectionUpdate = this.onConnectionUpdate;
this.AUTH_BUTTON.box.userData.loggedIn = await window.ic?.plug?.requestConnect({
whitelist,
onConnectionUpdate,
});
this.PRINCIPAL = await window.ic.plug.agent.getPrincipal();
}
async createActor(){
if (window.ic.plug?.agent) {
this.ACTOR = await window.ic.plug.createActor({
canisterId: this.CANISTER_ID,
interfaceFactory: this.INTERFACE,
});
};
return this.ACTOR
}
async logout(){
await window.ic.plug.disconnect();
}
async onConnectionUpdate(){
await this.createActor();
}
} And make calls on the actor as follows:
export class IC_IIAuth {
constructor(authButton, canisterId, AuthClient, HttpAgent, createActor, idProvider) {
this.is = 'INTERNET_COMPUTER_II_AUTH';
this.AUTH_BUTTON = authButton;
this.CANISTER_ID = canisterId;
this.AUTH_CLIENT = AuthClient;
this.HTTP_AGENT = HttpAgent;
this.CREATE_ACTOR = createActor;
this.ID_PROVIDER = idProvider;
this.CLIENT = undefined;
this.AGENT = undefined;
this.ACTOR = undefined;
this.PRINCIPAL = undefined;
}
async authenticate(){
try{
this.CLIENT = await this.AUTH_CLIENT.create();
}catch(err){
console.log(err);
}
try{
await new Promise((resolve) => {
this.CLIENT.login({
identityProvider: this.ID_PROVIDER,
onSuccess: resolve,
});
});
}catch(err){
console.log(err);
}
this.AUTH_BUTTON.box.userData.loggedIn = true;
const identity = this.CLIENT.getIdentity();
this.PRINCIPAL = identity.getPrincipal();
this.AGENT = new this.HTTP_AGENT({identity});
}
async createActor(){
const agent = this.AGENT;
this.ACTOR = this.CREATE_ACTOR(this.CANISTER_ID, {
agent,
});
return this.ACTOR
}
async logout(){
await this.CLIENT.logout();
}
} I can't track down what the difference is, anyone out there who has some ideas, I'd be appreciative. |
After updating to the later version v0.5.4.1 I consistently get an error saying "Failed to verify certificate" when using a local replica.
Repository: https://github.com/LiveDuo/plug-html-example
Wondering if someone has a working example of Plug extension working with a local replica after v0.5.3?
The text was updated successfully, but these errors were encountered: