File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -117,8 +117,6 @@ func (h Osxkeychain) List() (map[string]string, error) {
117117 default :
118118 return nil , err
119119 }
120- } else if len (res ) == 0 {
121- return nil , credentials .NewErrCredentialsNotFound ()
122120 }
123121
124122 resp := make (map [string ]string )
@@ -131,14 +129,22 @@ func (h Osxkeychain) List() (map[string]string, error) {
131129 return resp , nil
132130}
133131
132+ const (
133+ // Hardcoded protocol types matching their Objective-C equivalents.
134+ // https://developer.apple.com/documentation/security/ksecattrprotocolhttps?language=objc
135+ kSecProtocolTypeHTTPS = "htps" // This is NOT a typo.
136+ // https://developer.apple.com/documentation/security/ksecattrprotocolhttp?language=objc
137+ kSecProtocolTypeHTTP = "http"
138+ )
139+
134140func splitServer (serverURL string , item keychain.Item ) error {
135141 u , err := registryurl .Parse (serverURL )
136142 if err != nil {
137143 return err
138144 }
139- item .SetProtocol ("https" )
145+ item .SetProtocol (kSecProtocolTypeHTTPS )
140146 if u .Scheme == "http" {
141- item .SetProtocol ("http" )
147+ item .SetProtocol (kSecProtocolTypeHTTP )
142148 }
143149 item .SetServer (u .Hostname ())
144150 if p := u .Port (); p != "" {
You can’t perform that action at this time.
0 commit comments