1curl -v -k --digest -u admin:pass https://localhost/digest/
2* About to connect() to localhost port 443(#0)3* Trying ::1...
4* 接続を拒否されました
5* Trying 127.0.0.1...
6* Connected to localhost (127.0.0.1) port 443(#0)7* Initializing NSS with certpath: sql:/etc/pki/nssdb
8* skipping SSL peer certificate verification
9* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
10* Server certificate:
11* subject: CN=localhost
12* start date: 10月 1017:39:08 2018 GMT
13* expire date: 1月 08 17:39:08 2019 GMT
14* common name: localhost
15* issuer: CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US
16* Server auth using Digest with user 'admin'17> GET /digest/ HTTP/1.1
18> User-Agent: curl/7.29.0
19> Host: localhost
20> Accept: */*
21>22< HTTP/1.1 401 Unauthorized
23< Server: nginx
24< Date: Fri, 12 Oct 2018 07:37:01 GMT
25< Content-Type: text/html;charset=iso-8859-1
26< Content-Length: 38127< Connection: keep-alive
28< WWW-Authenticate: Digest realm="private Web", nonce="oI4tJwN4BQA=6f7eda4711047e2454eb8ad78f77c87ea309f079", algorithm=MD5, qop="auth"29<30* Ignoring the response-body
31* Connection #0 to host localhost left intact32* Issue another request to this URL: 'https://localhost/digest/'33* Found bundle forhost localhost: 0x24c6e20
34* Re-using existing connection!(#0) with host localhost35* Connected to localhost (127.0.0.1) port 443(#0)36* Server auth using Digest with user 'admin'37> GET /digest/ HTTP/1.1
38> Authorization: Digest username="admin", realm="private Web", nonce="oI4tJwN4BQA=6f7eda4711047e2454eb8ad78f77c87ea309f079", uri="/digest/", cnonce="ICAgICAgICAgICAgICAgICAgICAgICAgIDczODI1NTQ=", nc=00000001, qop=auth, response="06461008d7725ed115a2276e1a44b0e3", algorithm="MD5"39> User-Agent: curl/7.29.0
40> Host: localhost
41> Accept: */*
本題
さて、Alamofireで当該部分をどの様に作成しているのかという質問ですが、Alamofire自体はURLSession関連APIのラッパライブラリなので、Alamofire側ではなくURLSessionで生成している様です。 Document:Fetching Website Data into Memoryや、Objective-Cのサンプル
などを参考にAlamofireを利用しない実装をしても、algorithm="MD5"となっていました。おそらくsocketを利用して実装しないとこの部分はカスタマイズできない様にも思えます。(カスタマイズの仕方は探せませんでした)
総合的に考えると、クライアントの対応工数や、apacheのhttpdであれば、algorithm="MD5"でも許容することなどから、サーバ側が対応してもらえないのか交渉して貰うのが良いのではないでしょうか。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/15 02:05