Skip to content

.p12 and .p8 file not uploading in stream chat #300

Description

@AryanVerma

Hi I am using following piece of code and trying to upload .p12 or .p8 file it not upload in stream chat. Can anyone let me know what I am missing.

p12Data, err := readP12File("com.cadmiumcd.hmpconferences.p12") if err != nil { return fmt.Errorf("failed to read P12 file: %v", err) } // Parse certificate to extract details cert, err := parsePEMCertificate(pemData) if err != nil { return fmt.Errorf(ErrMsgParseCertificate, err) } pushProviderConfig := &stream_chat.PushProvider{ Name: "apn-provider-name-" + eventData.ClientID, Description: "APN Certificate for " + eventData.ClientName, Type: stream_chat.PushProviderAPNS, APNAuthKey: string(p12Data), APNKeyID: fmt.Sprintf("%X", cert.AuthorityKeyId), APNTeamID: string(cert.SubjectKeyId), // Alternative way if needed APNTopic: data[0].BundleID, } // Upload the APN certificate to Stream Chat _, err = client.UpsertPushProvider(context.Background(), pushProviderConfig) if err != nil { return fmt.Errorf("failed to upload APN certificate: %v", err) }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions