"to differentiate whether"
Solution 1:
This usage of differentiate is fine and both of your examples are perfectly valid.
There are thousands of published examples to back this up.
Solution 2:
It might be acceptable, but it is probably not recommended by style books.
Your first example sounds a bit off to me, while the second one could probably pass (see below). But I recommend using another construction instead, or a different verb.
There are several constructions that are commonly used with differentiate:
-
differentiate between A and B
Decimation does not differentiate between good and bad soldiers: every tenth man is executed at random.
-
differentiate A from B
Aristotle first differentiated living organisms from dead matter by exact criteria.
-
differentiate C [C is to consist of A and B]
We should differentiate the Greek poleis according to type of government: internal politics were vastly different between, say, Sparta and Athens.
-
differentiate [no object: A and B are implicit]
The Spartans mostly treated their slaves little better than beasts. The Athenians differentiated: household slaves were often cherished family members, while those working in the mines were subjected to cruel punishment and crippling labour.
The common element in these constructions is that there is a group of things that is to be split up in categories. I don't think you could differentiate things unless you had more than one thing and more than one category. The word and its constructions are quite similar to distinguish.
Compare this to your first example:
? He was not able to differentiate whether that wine was an expensive or a cheap wine.
There is only one wine in your example: that wine. It sounds a bit awkward to me: a verb like determine or tell would fit better. If you wanted to keep differentiate whether, you could adjust it like this:
He was unable to differentiate whether a wine was cheap or expensive. [I've also changed a few other things]
Now the faux connoisseur could be thought of as judging several wines; the sentence looks acceptable. But it is generally not recommended to use an uncommon word, in an unconventional construction, where a simpler word will do. Moreover, it is used to mean make out, determine, discern here, which it ordinarily does not mean: it involves creating different categories rather than observing existing ones, unlike distinguish, which is somewhere in between. The sentence would sound better either with a different construction or with a different verb:
He was unable to differentiate between cheap and expensive wines.
He was unable to determine whether that/a wine was cheap or expensive.
He couldn't tell whether that/a wine was cheap or expensive.
Compare this to your second example:
The client is not able to differentiate whether a request comes from the server or another client.
Here there are clearly several requests, which the client is to put into several categories; the sentence looks acceptable. In addition, there is no simple way to get rid of whether without dumping differentiate or increasing the length of the sentence. However, you could easily substitute a simpler verb, which would sound better:
The client is unable to determine whether requests are coming from the server or from another client. [I've also changed a few other things]
Solution 3:
What Cerberus said, with one addition. Use "between" when you have two items, but use "among" when you have three or more.